diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 2cfaed7588..261153eea7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -8,6 +8,7 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; @@ -27,7 +28,10 @@ import org.springframework.util.CollectionUtils; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; +import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; @@ -204,6 +208,67 @@ public class HttpClientManager { return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } + /** + * desc: 发送get请求 + * param:url, params + * return: CallResult + * date: 2019/2/21 9:16 + * + * @author: jianjun liu + */ + public Result sendGetFile(String url, Map params) { + + try { + URIBuilder builder = new URIBuilder(url); + if (!CollectionUtils.isEmpty(params)) { + Set set = params.keySet(); + for (String key : set) { + builder.setParameter(key, params.get(key) == null ? "" : String.valueOf(params.get(key))); + } + } + HttpGet httpGet = new HttpGet(builder.build()); + httpGet.setConfig(requestConfig); + return executeToByte(httpGet); + } catch (Exception e) { + log.error("sendGet exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + + private Result executeToByte(HttpRequestBase httpMethod) { + CloseableHttpResponse response = null; + try { + response = httpclient.execute(httpMethod); + log.debug("http send response:{}", JSON.toJSONString(response)); + if (response != null && response.getStatusLine() != null) { + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + InputStream in = response.getEntity().getContent(); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + byte[] buffer = new byte[4096]; + int n = 0; + while (-1 != (n = in.read(buffer))) { + output.write(buffer, 0, n); + } + return new Result().ok(ArrayUtils.toObject(output.toByteArray())); + } else { + log.warn("execute http method fail,httpStatus:{0}", response.getStatusLine().getStatusCode()); + } + } + } catch (Exception e) { + log.error("execute exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } finally { + httpMethod.releaseConnection(); + try { + if (response != null) { + response.close(); + } + } catch (IOException e) { + } + } + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + public static void main(String[] args) { String url = "http://localhost:8107/epmetscan/api/textSyncScan"; TextTaskDTO p = new TextTaskDTO(); diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java new file mode 100644 index 0000000000..8068f8f07b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class CodeAuditResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 代码ID + */ + private String codeId; + + /** + * 审核ID + */ + private String auditId; + + /** + * 审核结果 审核中:auditing,审核成功audit_success,审核被拒绝audit_failed,已撤回:withdrawn,审核延后:delay + */ + private String result; + + /** + * 原因 + */ + private String reason; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.java new file mode 100644 index 0000000000..960b9035cb --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户代码关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class CodeCustomerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户名 + */ + private String customerName; + + /** + * 小程序接口调用令牌ID + */ + private String accessTokenId; + + /** + * 模板ID + */ + private String templateId; + + /** + * 小程序类型 居民端resi,工作端work + */ + private String type; + + /** + * APPID + */ + private String appId; + + /** + * 自定义配置 + */ + private String extJson; + + /** + * 代码版本号 + */ + private String userVersion; + + /** + * 代码描述 + */ + private String userDesc; + + /** + * 状态 未审核:unaudited,审核中:auditing,审核成功audit_success,审核被拒绝audit_failed,已撤回:withdrawn,审核延后:delay,发布成功release_success, 发布失败release_failed + */ + private String status; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeMediaDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeMediaDTO.java new file mode 100644 index 0000000000..09332ac8a3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeMediaDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 代码素材 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class CodeMediaDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 代码ID + */ + private String codeId; + + /** + * 素材ID + */ + private String mediaId; + + /** + * 素材名 + */ + private String mediaName; + + /** + * 素材类型 图片(image)、语音(voice)、视频(video)和缩略图(thumb) + */ + private String mediaType; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CustomerCodeOperationHistoryDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CustomerCodeOperationHistoryDTO.java new file mode 100644 index 0000000000..9d400efb40 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CustomerCodeOperationHistoryDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户代码操作历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class CustomerCodeOperationHistoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 代码ID + */ + private String codeId; + + /** + * 版本 + */ + private String version; + + /** + * 操作类型 操作 上传upload,审核audit,撤回undo,发布release + */ + private String operation; + + /** + * 描述 + */ + private String describe; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeUploadFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeUploadFormDTO.java new file mode 100644 index 0000000000..a2740c321d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeUploadFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/9 14:24 + */ +@NoArgsConstructor +@Data +public class CodeUploadFormDTO implements Serializable { + + private static final long serialVersionUID = 1295337818281424509L; + /** + * 小程序接口调用令牌ID + */ + private String accessTokenId; + /** + * 小程序类型 居民端resi, 工作段work + */ + private String type; + /** + * 客户ID + */ + private String customerId; + /** + * 代码库中的代码模板 ID + */ + private String templateId; + /** + * 第三方自定义的配置 + */ + private String extJson; + /** + * 代码版本号 + */ + private String userVersion; + /** + * 代码描述 + */ + private String userDesc; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeAuditResultController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeAuditResultController.java new file mode 100644 index 0000000000..a0524c1b48 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeAuditResultController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CodeAuditResultDTO; +import com.epmet.service.CodeAuditResultService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@RestController +@RequestMapping("codeauditresult") +public class CodeAuditResultController { + + @Autowired + private CodeAuditResultService codeAuditResultService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = codeAuditResultService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CodeAuditResultDTO data = codeAuditResultService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CodeAuditResultDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + codeAuditResultService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CodeAuditResultDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + codeAuditResultService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + codeAuditResultService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java new file mode 100644 index 0000000000..1e97bf9ab1 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java @@ -0,0 +1,30 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CodeUploadFormDTO; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author zhaoqifeng + * @dscription 代码管理 + * @date 2020/7/9 11:02 + */ +@RestController +@RequestMapping("code") +public class CodeController { + + /** + * 代码上传 + * @author zhaoqifeng + * @date 2020/7/9 14:23 + * @param + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("upload") + public Result upload(@RequestBody CodeUploadFormDTO formDTO) { + return new Result<>(); + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeCustomerController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeCustomerController.java new file mode 100644 index 0000000000..d4a193821c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeCustomerController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CodeCustomerDTO; +import com.epmet.service.CodeCustomerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 客户代码关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@RestController +@RequestMapping("codecustomer") +public class CodeCustomerController { + + @Autowired + private CodeCustomerService codeCustomerService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = codeCustomerService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CodeCustomerDTO data = codeCustomerService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CodeCustomerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + codeCustomerService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CodeCustomerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + codeCustomerService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + codeCustomerService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeMediaController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeMediaController.java new file mode 100644 index 0000000000..c8ad829979 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeMediaController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CodeMediaDTO; +import com.epmet.service.CodeMediaService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 代码素材 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@RestController +@RequestMapping("codemedia") +public class CodeMediaController { + + @Autowired + private CodeMediaService codeMediaService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = codeMediaService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CodeMediaDTO data = codeMediaService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CodeMediaDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + codeMediaService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CodeMediaDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + codeMediaService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + codeMediaService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CustomerCodeOperationHistoryController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CustomerCodeOperationHistoryController.java new file mode 100644 index 0000000000..a764889ed6 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CustomerCodeOperationHistoryController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerCodeOperationHistoryDTO; +import com.epmet.service.CustomerCodeOperationHistoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 客户代码操作历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@RestController +@RequestMapping("customercodeoperationhistory") +public class CustomerCodeOperationHistoryController { + + @Autowired + private CustomerCodeOperationHistoryService customerCodeOperationHistoryService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerCodeOperationHistoryService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerCodeOperationHistoryDTO data = customerCodeOperationHistoryService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerCodeOperationHistoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerCodeOperationHistoryService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerCodeOperationHistoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerCodeOperationHistoryService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerCodeOperationHistoryService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditResultDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditResultDao.java new file mode 100644 index 0000000000..efbb43e81e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditResultDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CodeAuditResultEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Mapper +public interface CodeAuditResultDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java new file mode 100644 index 0000000000..fe783081fd --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CodeCustomerEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户代码关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Mapper +public interface CodeCustomerDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeMediaDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeMediaDao.java new file mode 100644 index 0000000000..ef06035847 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeMediaDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CodeMediaEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 代码素材 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Mapper +public interface CodeMediaDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerCodeOperationHistoryDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerCodeOperationHistoryDao.java new file mode 100644 index 0000000000..63ca70fb2b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerCodeOperationHistoryDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerCodeOperationHistoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户代码操作历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Mapper +public interface CustomerCodeOperationHistoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java new file mode 100644 index 0000000000..6226a7b08b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("code_audit_result") +public class CodeAuditResultEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 代码ID + */ + private String codeId; + + /** + * 审核ID + */ + private String auditId; + + /** + * 审核结果 审核中:auditing,审核成功audit_success,审核被拒绝audit_failed,已撤回:withdrawn,审核延后:delay + */ + private String result; + + /** + * 原因 + */ + private String reason; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.java new file mode 100644 index 0000000000..496aeacbc5 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户代码关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("code_customer") +public class CodeCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户名 + */ + private String customerName; + + /** + * 小程序接口调用令牌ID + */ + private String accessTokenId; + + /** + * 模板ID + */ + private String templateId; + + /** + * 小程序类型 居民端resi,工作端work + */ + private String type; + + /** + * APPID + */ + private String appId; + + /** + * 自定义配置 + */ + private String extJson; + + /** + * 代码版本号 + */ + private String userVersion; + + /** + * 代码描述 + */ + private String userDesc; + + /** + * 状态 未审核:unaudited,审核中:auditing,审核成功audit_success,审核被拒绝audit_failed,已撤回:withdrawn,审核延后:delay,发布成功release_success, 发布失败release_failed + */ + private String status; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeMediaEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeMediaEntity.java new file mode 100644 index 0000000000..51202ed323 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeMediaEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 代码素材 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("code_media") +public class CodeMediaEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 代码ID + */ + private String codeId; + + /** + * 素材ID + */ + private String mediaId; + + /** + * 素材名 + */ + private String mediaName; + + /** + * 素材类型 图片(image)、语音(voice)、视频(video)和缩略图(thumb) + */ + private String mediaType; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CustomerCodeOperationHistoryEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CustomerCodeOperationHistoryEntity.java new file mode 100644 index 0000000000..e747bb57d4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CustomerCodeOperationHistoryEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户代码操作历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_code_operation_history") +public class CustomerCodeOperationHistoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 代码ID + */ + private String codeId; + + /** + * 版本 + */ + private String version; + + /** + * 操作类型 操作 上传upload,审核audit,撤回undo,发布release + */ + private String operation; + + /** + * 描述 + */ + private String describe; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeAuditResultRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeAuditResultRedis.java new file mode 100644 index 0000000000..0b66bbd2b3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeAuditResultRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Component +public class CodeAuditResultRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeCustomerRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeCustomerRedis.java new file mode 100644 index 0000000000..6b5901d833 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeCustomerRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户代码关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Component +public class CodeCustomerRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeMediaRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeMediaRedis.java new file mode 100644 index 0000000000..99d1257967 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeMediaRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 代码素材 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Component +public class CodeMediaRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CustomerCodeOperationHistoryRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CustomerCodeOperationHistoryRedis.java new file mode 100644 index 0000000000..247e724de9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CustomerCodeOperationHistoryRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户代码操作历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Component +public class CustomerCodeOperationHistoryRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeAuditResultService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeAuditResultService.java new file mode 100644 index 0000000000..016a6e5abc --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeAuditResultService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CodeAuditResultDTO; +import com.epmet.entity.CodeAuditResultEntity; + +import java.util.List; +import java.util.Map; + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface CodeAuditResultService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CodeAuditResultDTO + * @author generator + * @date 2020-07-09 + */ + CodeAuditResultDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(CodeAuditResultDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(CodeAuditResultDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java new file mode 100644 index 0000000000..18ed92c92a --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CodeCustomerDTO; +import com.epmet.entity.CodeCustomerEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户代码关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface CodeCustomerService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CodeCustomerDTO + * @author generator + * @date 2020-07-09 + */ + CodeCustomerDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(CodeCustomerDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(CodeCustomerDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeMediaService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeMediaService.java new file mode 100644 index 0000000000..a4caade450 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeMediaService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CodeMediaDTO; +import com.epmet.entity.CodeMediaEntity; + +import java.util.List; +import java.util.Map; + +/** + * 代码素材 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface CodeMediaService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CodeMediaDTO + * @author generator + * @date 2020-07-09 + */ + CodeMediaDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(CodeMediaDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(CodeMediaDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java new file mode 100644 index 0000000000..1761ecf725 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java @@ -0,0 +1,12 @@ +package com.epmet.service; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/10 10:27 + */ +public interface CodeService { + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CustomerCodeOperationHistoryService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CustomerCodeOperationHistoryService.java new file mode 100644 index 0000000000..986fce9c09 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CustomerCodeOperationHistoryService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerCodeOperationHistoryDTO; +import com.epmet.entity.CustomerCodeOperationHistoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户代码操作历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface CustomerCodeOperationHistoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerCodeOperationHistoryDTO + * @author generator + * @date 2020-07-09 + */ + CustomerCodeOperationHistoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(CustomerCodeOperationHistoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(CustomerCodeOperationHistoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeAuditResultServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeAuditResultServiceImpl.java new file mode 100644 index 0000000000..7a4a7193cc --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeAuditResultServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.CodeAuditResultDao; +import com.epmet.dto.CodeAuditResultDTO; +import com.epmet.entity.CodeAuditResultEntity; +import com.epmet.redis.CodeAuditResultRedis; +import com.epmet.service.CodeAuditResultService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Service +public class CodeAuditResultServiceImpl extends BaseServiceImpl implements CodeAuditResultService { + + @Autowired + private CodeAuditResultRedis codeAuditResultRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CodeAuditResultDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CodeAuditResultDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CodeAuditResultDTO get(String id) { + CodeAuditResultEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CodeAuditResultDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CodeAuditResultDTO dto) { + CodeAuditResultEntity entity = ConvertUtils.sourceToTarget(dto, CodeAuditResultEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CodeAuditResultDTO dto) { + CodeAuditResultEntity entity = ConvertUtils.sourceToTarget(dto, CodeAuditResultEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java new file mode 100644 index 0000000000..1ccf7d1f28 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.CodeCustomerDao; +import com.epmet.dto.CodeCustomerDTO; +import com.epmet.entity.CodeCustomerEntity; +import com.epmet.redis.CodeCustomerRedis; +import com.epmet.service.CodeCustomerService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户代码关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Service +public class CodeCustomerServiceImpl extends BaseServiceImpl implements CodeCustomerService { + + @Autowired + private CodeCustomerRedis codeCustomerRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CodeCustomerDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CodeCustomerDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CodeCustomerDTO get(String id) { + CodeCustomerEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CodeCustomerDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CodeCustomerDTO dto) { + CodeCustomerEntity entity = ConvertUtils.sourceToTarget(dto, CodeCustomerEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CodeCustomerDTO dto) { + CodeCustomerEntity entity = ConvertUtils.sourceToTarget(dto, CodeCustomerEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeMediaServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeMediaServiceImpl.java new file mode 100644 index 0000000000..4447d8ed66 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeMediaServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.CodeMediaDao; +import com.epmet.dto.CodeMediaDTO; +import com.epmet.entity.CodeMediaEntity; +import com.epmet.redis.CodeMediaRedis; +import com.epmet.service.CodeMediaService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 代码素材 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Service +public class CodeMediaServiceImpl extends BaseServiceImpl implements CodeMediaService { + + @Autowired + private CodeMediaRedis codeMediaRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CodeMediaDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CodeMediaDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CodeMediaDTO get(String id) { + CodeMediaEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CodeMediaDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CodeMediaDTO dto) { + CodeMediaEntity entity = ConvertUtils.sourceToTarget(dto, CodeMediaEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CodeMediaDTO dto) { + CodeMediaEntity entity = ConvertUtils.sourceToTarget(dto, CodeMediaEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java new file mode 100644 index 0000000000..728852e30c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -0,0 +1,17 @@ +package com.epmet.service.impl; + +import com.epmet.service.CodeService; +import me.chanjar.weixin.common.error.WxErrorException; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/10 10:27 + */ +@Service +public class CodeServiceImpl implements CodeService { + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerCodeOperationHistoryServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerCodeOperationHistoryServiceImpl.java new file mode 100644 index 0000000000..fc424619cc --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerCodeOperationHistoryServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.CustomerCodeOperationHistoryDao; +import com.epmet.dto.CustomerCodeOperationHistoryDTO; +import com.epmet.entity.CustomerCodeOperationHistoryEntity; +import com.epmet.redis.CustomerCodeOperationHistoryRedis; +import com.epmet.service.CustomerCodeOperationHistoryService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户代码操作历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Service +public class CustomerCodeOperationHistoryServiceImpl extends BaseServiceImpl implements CustomerCodeOperationHistoryService { + + @Autowired + private CustomerCodeOperationHistoryRedis customerCodeOperationHistoryRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerCodeOperationHistoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerCodeOperationHistoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CustomerCodeOperationHistoryDTO get(String id) { + CustomerCodeOperationHistoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerCodeOperationHistoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerCodeOperationHistoryDTO dto) { + CustomerCodeOperationHistoryEntity entity = ConvertUtils.sourceToTarget(dto, CustomerCodeOperationHistoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerCodeOperationHistoryDTO dto) { + CustomerCodeOperationHistoryEntity entity = ConvertUtils.sourceToTarget(dto, CustomerCodeOperationHistoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java index 2aae2d8234..3fe8d49f7e 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java @@ -6,7 +6,7 @@ package com.epmet.wxapi.constant; * @author yinzuomei@elink-cn.com * @date 2020/7/10 12:57 */ -public class WxMaCodeConstant { +public interface WxMaCodeConstant { /** * 为授权的小程序帐号上传小程序代码. */ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatus.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatus.java new file mode 100644 index 0000000000..0115b8d9d2 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatus.java @@ -0,0 +1,9 @@ +package com.epmet.wxapi.param; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/10 18:05 + */ +public class WxMaCodeAuditStatus { +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatusReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatusReq.java new file mode 100644 index 0000000000..b2fdf65fae --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatusReq.java @@ -0,0 +1,18 @@ +package com.epmet.wxapi.param; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/13 15:49 + */ +@Data +public class WxMaCodeAuditStatusReq implements Serializable { + private static final long serialVersionUID = -504705519949598098L; + @SerializedName("auditid") + private String auditId; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeCommitReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeCommitReq.java index 3054446c7f..9e24a99689 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeCommitReq.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeCommitReq.java @@ -1,5 +1,6 @@ package com.epmet.wxapi.param; +import com.google.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; @@ -17,18 +18,23 @@ public class WxMaCodeCommitReq implements Serializable { /** * 代码库中的代码模版ID */ - private Long templateId; + @SerializedName("template_id") + private String templateId; /** * 第三方自定义的配置 */ - private WxMaCodeExtConfigReq extConfig; + @SerializedName("ext_json") + private String extJson; /** * 代码版本号,开发者可自定义 */ + @SerializedName("user_version") private String userVersion; /** * 代码描述,开发者可自定义 */ + + @SerializedName("user_desc") private String userDesc; } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeSubmitAuditRequest.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeSubmitAuditRequest.java new file mode 100644 index 0000000000..c9fa07b8e4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeSubmitAuditRequest.java @@ -0,0 +1,145 @@ +package com.epmet.wxapi.param; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/10 18:04 + */ +@NoArgsConstructor +@Data +public class WxMaCodeSubmitAuditRequest implements Serializable { + + private static final long serialVersionUID = -3919598581372634816L; + /** + * 小程序版本说明和功能解释 + */ + @SerializedName("version_desc") + private String versionDesc; + /** + * 反馈内容,至多 200 字 + */ + @SerializedName("feedback_info") + private String feedbackInfo; + /** + * 用 | 分割的 media_id 列表,至多 5 张图片, 可以通过新增临时素材接口上传而得到 + */ + @SerializedName("feedback_stuff") + private String feedbackStuff; + /** + * 审核项列表(选填,至多填写 5 项) + */ + @SerializedName("item_list") + private List itemList; + /** + * 预览信息(小程序页面截图和操作录屏) + */ + @SerializedName("preview_info") + private List previewInfo; + /** + * 用户生成内容场景(UGC)信息安全声明 + */ + @SerializedName("ugc_declare") + private List ugcDeclare; + + @NoArgsConstructor + @Data + private static class ItemListBean { + /** + * 小程序的页面,可通过获取小程序的页面列表接口获得 + */ + @SerializedName("address") + private String address; + /** + * 小程序的标签,用空格分隔,标签至多 10 个,标签长度至多 20 + */ + @SerializedName("tag") + private String tag; + /** + * 一级类目名称 + */ + @SerializedName("first_class") + private String firstClass; + /** + * 二级类目名称 + */ + @SerializedName("second_class") + private String secondClass; + /** + * 三级类目名称 + */ + @SerializedName("third_class") + private String thirdClass; + /** + * 一级类目的 ID + */ + @SerializedName("first_id") + private String firstId; + /** + * 二级类目的 ID + */ + @SerializedName("second_id") + private String secondId; + /** + * 三级类目的 ID + */ + @SerializedName("third_id") + private String thirdId; + /** + * 小程序页面的标题,标题长度至多 32 + */ + @SerializedName("title") + private String title; + } + + @NoArgsConstructor + @Data + private static class PreviewInfoBean { + /** + * 录屏mediaid列表,可以通过提审素材上传接口获得 + */ + @SerializedName("Video_id_list") + private List videoIdList; + /** + * 截屏mediaid列表,可以通过提审素材上传接口获得 + */ + @SerializedName("pic_id_list") + private List picIdList; + } + + @NoArgsConstructor + @Data + private static class UgcDeclareBean { + /** + * UGC场景 0,不涉及用户生成内容, 1.用户资料,2.图片,3.视频,4.文本,5其他, 可多选,当scene填0时无需填写下列字段 + */ + @SerializedName("scene") + private List scene; + /** + * 当scene选其他时的说明,不超时256字 + */ + @SerializedName("other_scene_desc") + private String otherSceneDesc; + /** + * 内容安全机制 1.使用平台建议的内容安全API,2.使用其他的内容审核产品,3.通过人工审核把关,4.未做内容审核把关 + */ + @SerializedName("method") + private List method; + /** + * 是否有审核团队, 0.无,1.有,默认0 + */ + @SerializedName("has_audit_team") + private Integer hasAuditTeam; + /** + * 说明当前对UGC内容的审核机制,不超过256字 + */ + @SerializedName("audit_desc") + private String auditDesc; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaAuditStatusResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaAuditStatusResult.java new file mode 100644 index 0000000000..ea39ebae7e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaAuditStatusResult.java @@ -0,0 +1,36 @@ +package com.epmet.wxapi.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/13 15:53 + */ +@Data +public class WxMaAuditStatusResult implements Serializable { + private static final long serialVersionUID = 3461409352381952089L; + /** + * 返回码 + */ + private String errcode; + /** + * 错误信息 + */ + private String errmsg; + /** + * 审核状态 + */ + private Integer status; + /** + * 当 status = 1 时,返回的拒绝原因; status = 4 时,返回的延后原因 + */ + private String reason; + /** + * 当 status = 1 时,会返回审核失败的小程序截图示例。用 | 分隔的 media_id 的列表,可通过获取永久素材接口拉取截图内容 + */ + private String screenshot; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaCategoryResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaCategoryResult.java new file mode 100644 index 0000000000..a8bbb25e5e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaCategoryResult.java @@ -0,0 +1,52 @@ +package com.epmet.wxapi.result; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/10 16:51 + */ +@Data +public class WxMaCategoryResult implements Serializable { + /** + * 一级类目名称 + */ + private String firstClass; + /** + * 二级类目名称 + */ + private String secondClass; + /** + * 三级类目名称 + */ + private String thirdClass; + /** + * 一级类目的ID编号 + */ + private String firstId; + /** + * 二级类目的ID编号 + */ + private String secondId; + /** + * 三级类目的ID编号 + */ + private String thirdId; + + /** + * 小程序的页面,可通过“获取小程序的第三方提交代码的页面配置”接口获得 + */ + private String address; + /** + * 小程序的标签,多个标签用空格分隔,标签不能多于10个,标签长度不超过20 + */ + private String tag; + /** + * 小程序页面的标题,标题长度不超过32 + */ + private String title; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetCategoryResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetCategoryResult.java new file mode 100644 index 0000000000..b120ad55df --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetCategoryResult.java @@ -0,0 +1,28 @@ +package com.epmet.wxapi.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/13 10:17 + */ +@Data +public class WxMaGetCategoryResult implements Serializable { + private static final long serialVersionUID = -2665257152145041516L; + /** + * 返回码 + */ + private Integer errcode; + /** + * 错误信息 + */ + private String errmsg; + /** + * 可填选的类目信息列表 + */ + private List categoryList; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetPageResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetPageResult.java new file mode 100644 index 0000000000..5305288c88 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetPageResult.java @@ -0,0 +1,28 @@ +package com.epmet.wxapi.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/13 13:38 + */ +@Data +public class WxMaGetPageResult implements Serializable { + private static final long serialVersionUID = -3057343239059623208L; + /** + * 返回码 + */ + private Integer errcode; + /** + * 错误信息 + */ + private String errmsg; + /** + * 错误信息 + */ + private List pageList; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java index f34511cfec..b329dabe14 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java @@ -1,9 +1,15 @@ package com.epmet.wxapi.service; +import com.epmet.wxapi.param.WxMaCodeAuditStatus; +import com.epmet.wxapi.param.WxMaCodeAuditStatusReq; import com.epmet.wxapi.param.WxMaCodeCommitReq; +import com.epmet.wxapi.param.WxMaCodeSubmitAuditRequest; +import com.epmet.wxapi.result.WxMaCategoryResult; import com.epmet.wxapi.result.WxResult; import me.chanjar.weixin.common.error.WxErrorException; +import java.util.List; + /** * 小程序代码管理相关 API(大部分只能是第三方平台调用) * 文档:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1489140610_Uavc4&token=&lang=zh_CN @@ -14,9 +20,73 @@ import me.chanjar.weixin.common.error.WxErrorException; public interface WxMaCodeService { /** * 为授权的小程序帐号上传小程序代码(仅仅支持第三方开放平台). - * - * @param commitRequest 参数 + * @author zhaoqifeng + * @date 2020/7/10 14:11 + * @param accessToken 小程序接口调用令牌 + * @param commitRequest 请求参数 + * @return com.epmet.wxapi.result.WxResult * @throws WxErrorException 上传失败时抛出,具体错误码请看类注释文档 */ - WxResult commit(String access_token, WxMaCodeCommitReq commitRequest) throws WxErrorException; + WxResult commit(String accessToken, WxMaCodeCommitReq commitRequest) throws WxErrorException; + + /** + * 获取体验小程序的体验二维码. + * @author zhaoqifeng + * @date 2020/7/10 15:25 + * @param accessToken 小程序接口调用令牌 + * @param path 指定体验版二维码跳转到某个具体页面 + * @return com.epmet.wxapi.result.WxResult + * @throws WxErrorException 抛出异常 + */ + WxResult getQrCode(String accessToken, String path) throws WxErrorException; + + /** + * 获取授权小程序帐号的可选类目. + * + * @param accessToken 提交审核参数 + * @return List + */ + WxResult getCategory(String accessToken); + + /** + * 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用). + * + * @param accessToken 提交审核参数 + * @return page_list 页面配置列表 + */ + WxResult getPage(String accessToken); + + /** + * 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用). + * + * @param accessToken 提交审核参数 + * @param auditRequest 提交审核参数 + * @return 审核编号 + */ + WxResult submitAudit(String accessToken, WxMaCodeSubmitAuditRequest auditRequest); + + /** + * 查询指定版本审核状态(仅供第三方代小程序调用). + * + * @param accessToken 提交审核参数 + * @return 审核状态 + */ + WxResult getAuditStatus(String accessToken, WxMaCodeAuditStatusReq request); + + /** + * 发布已通过审核的小程序(仅供第三方代小程序调用). + * + * @param accessToken 提交审核参数 + * @return 发布结果 + */ + WxResult release(String accessToken); + + /** + * 小程序审核撤回. + * 单个帐号每天审核撤回次数最多不超过1次,一个月不超过10次 + * + * @param accessToken 提交审核参数 + * @return 撤回结果 + */ + WxResult undoCodeAudit(String accessToken); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java index 99860706eb..2ae3ff2443 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java @@ -1,11 +1,30 @@ package com.epmet.wxapi.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.wxapi.constant.WxMaCodeConstant; +import com.epmet.wxapi.param.WxMaCodeAuditStatus; +import com.epmet.wxapi.param.WxMaCodeAuditStatusReq; import com.epmet.wxapi.param.WxMaCodeCommitReq; -import com.epmet.wxapi.result.WxResult; +import com.epmet.wxapi.param.WxMaCodeSubmitAuditRequest; +import com.epmet.wxapi.result.*; import com.epmet.wxapi.service.WxMaCodeService; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import io.micrometer.core.instrument.util.JsonUtils; +import lombok.Data; import me.chanjar.weixin.common.error.WxErrorException; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; + /** * 描述一下 * @@ -14,9 +33,161 @@ import org.springframework.stereotype.Service; */ @Service public class WxMaCodeServiceImpl implements WxMaCodeService { + private static final String ERR_CODE = "errcode"; + private static final String ERR_MSG = "errmsg"; + + @Override + public WxResult commit(String accessToken, WxMaCodeCommitReq commitRequest) throws WxErrorException { + WxResult result = new WxResult(); + String url = WxMaCodeConstant.COMMIT_URL + "?" + "access_token=" + accessToken; + Result commitResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(commitRequest)); + if(!commitResult.success()) { + result.setErrorCode(commitResult.getCode()); + result.setErrorMsg(commitResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(commitResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(jsonObject.getString(ERR_MSG)); + return result; + } + + @Override + public WxResult getQrCode(String accessToken, String path) throws WxErrorException{ + WxResult result = new WxResult<>(); + StringBuilder url = new StringBuilder(WxMaCodeConstant.GET_QRCODE_URL).append("?access_token").append(accessToken); + if (StringUtils.isNotBlank(path)) { + try { + url.append("?path=").append(URLEncoder.encode(path, StandardCharsets.UTF_8.name())); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + Result qrCodeResult = HttpClientManager.getInstance().sendGetFile(url.toString(), null); + if(!qrCodeResult.success()) { + result.setErrorCode(qrCodeResult.getCode()); + result.setErrorMsg(qrCodeResult.getMsg()); + return result; + } + + result.setData(qrCodeResult.getData()); + + return result; + } + @Override - public WxResult commit(String access_token, WxMaCodeCommitReq commitRequest) throws WxErrorException { + public WxResult getCategory(String accessToken) { + WxResult> result = new WxResult<>(); + String url = WxMaCodeConstant.GET_CATEGORY_URL + "?" + "access_token=" + accessToken; + Result getCategoryResult = HttpClientManager.getInstance().sendGet(url, null); + if(!getCategoryResult.success()) { + result.setErrorCode(getCategoryResult.getCode()); + result.setErrorMsg(getCategoryResult.getMsg()); + return result; + } + WxMaGetCategoryResult categoryResult = JSONObject.parseObject(getCategoryResult.getData(), WxMaGetCategoryResult.class); + result.setErrorCode(categoryResult.getErrcode()); + result.setErrorMsg(categoryResult.getErrmsg()); + result.setData(categoryResult.getCategoryList()); + return result; + } + + @Override + public WxResult getPage(String accessToken) { + WxResult> result = new WxResult<>(); + String url = WxMaCodeConstant.GET_PAGE_URL + "?" + "access_token=" + accessToken; + Result getPageResult = HttpClientManager.getInstance().sendGet(url, null); + if(!getPageResult.success()) { + result.setErrorCode(getPageResult.getCode()); + result.setErrorMsg(getPageResult.getMsg()); + return result; + } + WxMaGetPageResult pageResult = JSONObject.parseObject(getPageResult.getData(), WxMaGetPageResult.class); + result.setErrorCode(pageResult.getErrcode()); + result.setErrorMsg(pageResult.getErrmsg()); + result.setData(pageResult.getPageList()); + return result; + } - return null; + @Override + public WxResult submitAudit(String accessToken, WxMaCodeSubmitAuditRequest auditRequest) { + WxResult result = new WxResult(); + String url = WxMaCodeConstant.SUBMIT_AUDIT_URL + "?" + "access_token=" + accessToken; + Result submitResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(auditRequest)); + if(!submitResult.success()) { + result.setErrorCode(submitResult.getCode()); + result.setErrorMsg(submitResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(submitResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(jsonObject.getString(ERR_MSG)); + return result; + } + + @Override + public WxResult getAuditStatus(String accessToken, WxMaCodeAuditStatusReq request) { + WxResult result = new WxResult<>(); + String url = WxMaCodeConstant.COMMIT_URL + "?" + "access_token=" + accessToken; + Result statusResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if(!statusResult.success()) { + result.setErrorCode(statusResult.getCode()); + result.setErrorMsg(statusResult.getMsg()); + return result; + } + WxMaAuditStatusResult auditStatusResult = JSONObject.parseObject(statusResult.getData(), WxMaAuditStatusResult.class); + result.ok(auditStatusResult); + return result; + } + + @Override + public WxResult release(String accessToken) { + WxResult result = new WxResult(); + String url = WxMaCodeConstant.RELEASE_URL + "?" + "access_token=" + accessToken; + Result releaseResult = HttpClientManager.getInstance().sendPostByJSON(url, null); + if(!releaseResult.success()) { + result.setErrorCode(releaseResult.getCode()); + result.setErrorMsg(releaseResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(releaseResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(jsonObject.getString(ERR_MSG)); + return result; + } + + @Override + public WxResult undoCodeAudit(String accessToken) { + WxResult result = new WxResult(); + String url = WxMaCodeConstant.UNDO_CODE_AUDIT_URL + "?" + "access_token=" + accessToken; + Result undoResult = HttpClientManager.getInstance().sendGet(url, null); + if(!undoResult.success()) { + result.setErrorCode(undoResult.getCode()); + result.setErrorMsg(undoResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(undoResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(jsonObject.getString(ERR_MSG)); + return result; + } + + public static void main(String[] args) { + String url = "{\"errcode\":0,\"errmsg\":\"ok\",\"category_list\":[{\"first_class\":\"工具\",\"second_class\":\"备忘录\",\"first_id\":1,\"second_id\":2,}\n" + + "{\"first_class\":\"教育\",\"second_class\":\"学历教育\",\"third_class\":\"高等\",\"first_id\":3,\"second_id\":4,\"third_id\":5,}]}"; + WxMaGetCategoryResult video = JSONObject.parseObject(url, WxMaGetCategoryResult.class); + WxResult> result = new WxResult<>(); + result.setErrorCode(video.getErrcode()); + result.setErrorMsg(video.getErrmsg()); + result.setData(video.getCategoryList()); + System.out.println(result); + WxMaCodeSubmitAuditRequest request = new WxMaCodeSubmitAuditRequest(); + request.setVersionDesc("aasdf"); + } + private String toJson(Object object) { + GsonBuilder gsonBuilder = new GsonBuilder(); + gsonBuilder.setPrettyPrinting(); + Gson gson = gsonBuilder.create(); + return gson.toJson(object); } -} +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditResultDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditResultDao.xml new file mode 100644 index 0000000000..f393abeb44 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditResultDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml new file mode 100644 index 0000000000..e6d65e78e4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeMediaDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeMediaDao.xml new file mode 100644 index 0000000000..c89b8a54d3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeMediaDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerCodeOperationHistoryDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerCodeOperationHistoryDao.xml new file mode 100644 index 0000000000..09ae8b2e78 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerCodeOperationHistoryDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file