当前位置: 首页 > news >正文

经营阅读网站需要怎么做下载百度免费版

经营阅读网站需要怎么做,下载百度免费版,陕西金顶建设公司网站,it运维需要学哪些知识灵感来自于一项重复的工作#xff0c;下图中#xff0c;这类禁用启用、审核通过不通过、设计成是什么状态否什么状态的场景很多。每一个都需要单独提供接口。重复工作还蛮大的。于是#xff0c;基于该组件类捕获组件跳转写了这款通用接口。省时省力。 代码如下#xff1a;…灵感来自于一项重复的工作下图中这类禁用启用、审核通过不通过、设计成是什么状态否什么状态的场景很多。每一个都需要单独提供接口。重复工作还蛮大的。于是基于该组件类捕获组件跳转写了这款通用接口。省时省力。 代码如下 /** 文件名称: 类UnifyBatchUpdateEndpoint* 文件描述:* 创建人: simple_zeng* 创建时间: 2024/6/8*/ RestController public class UnifyBatchUpdateEndpoint implements InterestedClassAware {Autowiredprivate SqlScriptExecutor sqlScriptExecutor;// 实体类名对应tableIdprivate static MapString, UnifyBatch BUCKET new HashMap();RequestMapping(/unify/status)public JsonResult unifyBatchUpdate(RequestBody UnifyBatchUpdate unifyBatchUpdate) {ListString ids unifyBatchUpdate.getIds();if (ZYListUtils.isEmptyList(ids)) {throw new LocalException(请至少选择一条数据);}Integer status unifyBatchUpdate.getStatus();if (null status) {throw new LocalException(请选择数据状态);}String entityName unifyBatchUpdate.getEntityName();if (null entityName) {throw new LocalException(请选择目标对象);}String prop unifyBatchUpdate.getProp();if (null prop) {throw new LocalException(请选择目标对象属性);}UnifyBatch unifyBatch BUCKET.get(entityName.toLowerCase());if (null unifyBatch) {throw new LocalException(不能识别的状态类型);}String tableName unifyBatch.getTableName(); // 表名String keyColumnName unifyBatch.getKeyColumnName(); // 主键字段名String column unifyBatch.getColumn(prop); // 状态字段名String idInWhere ZYWrapperHelper.toIn(ids); // id条件String sqlTemplate update %s set %s%s where %s in %s; // update sys_user set is_using1 where id in (1)String sql String.format(sqlTemplate, tableName, column, status, keyColumnName, idInWhere);sqlScriptExecutor.executeUpdateScript(sql);return JsonResult.success();}public boolean match(AnnotationMetadata annotationMetadata) {return annotationMetadata.hasAnnotation(TableName.class.getName());}Overridepublic void setClasses(SetClass? classes) {for (Class? aClass : classes) {TableName tableName aClass.getAnnotation(TableName.class);if (null tableName) {continue;}String simpleName aClass.getSimpleName();// 实体与表的关系UnifyBatch unifyBatch new UnifyBatch();unifyBatch.setTableName(tableName.value());Field[] fields ZYReflectUtils.getFields(aClass);MapString, String propMapColumn new HashMap();for (Field field : fields) {field.setAccessible(true);Class? type field.getType();// 主键TableId tableId field.getAnnotation(TableId.class);if (null ! tableId) {unifyBatch.setKeyColumnName(tableId.value());}// 只处理int类型的状态值修改if (!Integer.class.isAssignableFrom(type)) {continue;}// 字段TableField tableField field.getAnnotation(TableField.class);if (null ! tableField) {propMapColumn.put(field.getName().toLowerCase(), tableField.value());}}unifyBatch.setPropMapColumn(propMapColumn);if (!unifyBatch.empty()) {BUCKET.put(simpleName.toLowerCase(), unifyBatch);}}} }Data public class UnifyBatchUpdate implements Serializable {private ListString ids;private String entityName;private String prop;private Integer status; }Data public class UnifyBatch {private String tableName;private String keyColumnName;private MapString, String propMapColumn;public String getColumn(String prop) {return null ! propMapColumn ? propMapColumn.get(prop.toLowerCase()) : null;}public boolean empty() {if (ZYStrUtils.isNull(tableName)) {return true;}if (ZYStrUtils.isNull(keyColumnName)) {return true;}if (null propMapColumn || propMapColumn.isEmpty()) {return true;}return false;} }调用示例后端不用写任何代码只需要告诉前端调哪个实体类和某个属性即可。岂不美哉。 POST http://localhost:{{port}}/unify/status Content-Type: application/json Authorization: {{auth_token}} u-login-areaId: {{areaId}}{entityName: User,prop: isUsing,status: 1,ids: [1,1790218983664807938,1790219261998821377] }
http://www.dnsts.com.cn/news/95889.html

相关文章:

  • ps做网站教程三亚网站建设哪家专业
  • 合肥制作企业网站上海网站排名公司
  • 销售类网站开发架构购物网站建设开发
  • 网站开发需要什么金融行业网站建设
  • 石家庄网站开发哪家好竞价推广软件
  • 包头正规旅游网站开发哪家好网站开发的公司电话
  • 企业网站如何推广东莞东城社保局电话
  • 做a 免费网站wordpress仿砍柴网
  • 给女朋友做的网站视频网站开发报告
  • 网站开发团队如何接活邯郸移动网站建设
  • 门户网站建设推荐网站移动端适配怎么做
  • 鄱阳网站建设企业网站建设公司郑州
  • 深圳网站设计公司在什么地方百度关键词点击工具
  • 找做外墙油漆网站论坛企业推广
  • 网站制作教程pptwordpress搜索功能优化
  • 做电影网站怎样赚钱吗wordpress中目录如何表示
  • 高校网站建设的时效性上海教育网站建设
  • 哪个网站找做软件下载小城镇建设期刊网站
  • 销售网站建设常遇到的问题购买的网站怎么看网站空间大小
  • 六安seo网站推广报价商城网站案例
  • 信息化建设好的企业网站有哪些公司注册上海
  • 泰州做兼职的网站引导交互 网站
  • 一起做网店网站打不开深圳市文刀网站建设
  • 网站开发前端和后端用什么语言有没有做家纺类的网站
  • 中小企业还需要网站吗广告公司简介宣传册
  • 广安 网站建设休闲吧网站建设
  • 无锡网站怎么做wordpress搜索所有类
  • 做酒店网站wordpress网站地图插件
  • 个人怎么开网站马可波罗网介绍
  • 网站怎样做wap端济宁正德网站建设