Commit 8fa26a5ac0ea938183a59be41a7ec944746fefa7
1 parent
3387ea6e
fix: 集成swagger ui
Showing
13 changed files
with
69 additions
and
96 deletions
src/main/java/com/order/erp/AdminApplication.java
... | ... | @@ -12,6 +12,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
12 | 12 | import org.springframework.context.annotation.Bean; |
13 | 13 | import org.springframework.scheduling.annotation.EnableAsync; |
14 | 14 | import org.springframework.transaction.annotation.EnableTransactionManagement; |
15 | +import springfox.documentation.swagger2.annotations.EnableSwagger2; | |
15 | 16 | |
16 | 17 | /** |
17 | 18 | * @author: xms |
... | ... | @@ -23,6 +24,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; |
23 | 24 | @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.order.erp"}) |
24 | 25 | @MapperScan("com.order.erp.**.mapper") |
25 | 26 | @EnableTransactionManagement |
27 | +@EnableSwagger2 | |
26 | 28 | public class AdminApplication { |
27 | 29 | |
28 | 30 | private static void setLogPath() { | ... | ... |
src/main/java/com/order/erp/config/WebConfig.java
... | ... | @@ -7,6 +7,7 @@ import org.springframework.context.annotation.Configuration; |
7 | 7 | import org.springframework.http.MediaType; |
8 | 8 | import org.springframework.http.converter.HttpMessageConverter; |
9 | 9 | import org.springframework.http.converter.StringHttpMessageConverter; |
10 | +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; | |
10 | 11 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
11 | 12 | |
12 | 13 | import java.nio.charset.StandardCharsets; |
... | ... | @@ -81,4 +82,15 @@ public class WebConfig implements WebMvcConfigurer { |
81 | 82 | fastConverter.setDefaultCharset(StandardCharsets.UTF_8); |
82 | 83 | return fastConverter; |
83 | 84 | } |
85 | + | |
86 | + @Override | |
87 | + public void addResourceHandlers(ResourceHandlerRegistry registry) { | |
88 | + registry.addResourceHandler("/**").addResourceLocations( | |
89 | + "classpath:/static/"); | |
90 | + registry.addResourceHandler("swagger-ui.html").addResourceLocations( | |
91 | + "classpath:/META-INF/resources/"); | |
92 | + registry.addResourceHandler("/webjars/**").addResourceLocations( | |
93 | + "classpath:/META-INF/resources/webjars/"); | |
94 | + WebMvcConfigurer.super.addResourceHandlers(registry); | |
95 | + } | |
84 | 96 | } | ... | ... |
src/main/java/com/order/erp/controller/AuditController.java
... | ... | @@ -6,6 +6,8 @@ import com.order.erp.domain.AuditStatusEnum; |
6 | 6 | import com.order.erp.domain.vo.order.AuditVO; |
7 | 7 | import com.order.erp.domain.vo.order.OrderFieldLockApplyQueryVO; |
8 | 8 | import com.order.erp.service.order.OrderFieldLockApplyService; |
9 | +import io.swagger.annotations.Api; | |
10 | +import io.swagger.annotations.ApiOperation; | |
9 | 11 | import org.springframework.validation.annotation.Validated; |
10 | 12 | import org.springframework.web.bind.annotation.PostMapping; |
11 | 13 | import org.springframework.web.bind.annotation.RequestBody; |
... | ... | @@ -20,6 +22,7 @@ import javax.annotation.Resource; |
20 | 22 | * @author makejava |
21 | 23 | * @since 2023-09-08 15:26:43 |
22 | 24 | */ |
25 | +@Api(tags = "审批管理") | |
23 | 26 | @RestController |
24 | 27 | @RequestMapping("/order/erp/audit") |
25 | 28 | public class AuditController { |
... | ... | @@ -36,6 +39,7 @@ public class AuditController { |
36 | 39 | * @return 查询结果 |
37 | 40 | */ |
38 | 41 | @PostMapping("/list_by_page") |
42 | + @ApiOperation("分页查询") | |
39 | 43 | @AnonymousAccess |
40 | 44 | public ServerResult listByPage(@RequestBody @Validated OrderFieldLockApplyQueryVO queryVO) { |
41 | 45 | return applyService.listByPage(queryVO); |
... | ... | @@ -47,6 +51,7 @@ public class AuditController { |
47 | 51 | * @param queryVO 查询条件 |
48 | 52 | * @return 查询结果 |
49 | 53 | */ |
54 | + @ApiOperation("待审批列表") | |
50 | 55 | @PostMapping("/wait_audit_list") |
51 | 56 | @AnonymousAccess |
52 | 57 | public ServerResult waitAuditList(@RequestBody @Validated OrderFieldLockApplyQueryVO queryVO) { |
... | ... | @@ -60,6 +65,7 @@ public class AuditController { |
60 | 65 | * @param queryVO 查询条件 |
61 | 66 | * @return 查询结果 |
62 | 67 | */ |
68 | + @ApiOperation("已审批列表") | |
63 | 69 | @PostMapping("/audit_list") |
64 | 70 | @AnonymousAccess |
65 | 71 | public ServerResult auditList(@RequestBody @Validated OrderFieldLockApplyQueryVO queryVO) { |
... | ... | @@ -73,6 +79,7 @@ public class AuditController { |
73 | 79 | * @param auditVO 查询条件 |
74 | 80 | * @return 查询结果 |
75 | 81 | */ |
82 | + @ApiOperation("审核") | |
76 | 83 | @PostMapping("/do_audit") |
77 | 84 | @AnonymousAccess |
78 | 85 | public ServerResult doAudit(@RequestBody @Validated AuditVO auditVO) { | ... | ... |
src/main/java/com/order/erp/controller/CaptchaController.java
... | ... | @@ -6,6 +6,8 @@ import com.order.erp.common.utils.ImgCaptchaUtils; |
6 | 6 | import com.order.erp.common.utils.SmsUtils; |
7 | 7 | import com.order.erp.domain.vo.CaptchaMessageVO; |
8 | 8 | import com.wf.captcha.ArithmeticCaptcha; |
9 | +import io.swagger.annotations.Api; | |
10 | +import io.swagger.annotations.ApiOperation; | |
9 | 11 | import org.springframework.validation.annotation.Validated; |
10 | 12 | import org.springframework.web.bind.annotation.PostMapping; |
11 | 13 | import org.springframework.web.bind.annotation.RequestBody; |
... | ... | @@ -23,6 +25,7 @@ import java.util.Map; |
23 | 25 | * @since 2023-08-22 17:02:39 |
24 | 26 | */ |
25 | 27 | @RestController |
28 | +@Api(tags = "验证码") | |
26 | 29 | @RequestMapping("/order/erp/captcha") |
27 | 30 | public class CaptchaController { |
28 | 31 | |
... | ... | @@ -39,6 +42,7 @@ public class CaptchaController { |
39 | 42 | * @return 查询结果 |
40 | 43 | */ |
41 | 44 | @AnonymousAccess |
45 | + @ApiOperation("获取验证码") | |
42 | 46 | @PostMapping("/send_captcha_code") |
43 | 47 | public ServerResult sendCaptchaCode(@RequestBody @Validated CaptchaMessageVO msgVo) { |
44 | 48 | return smsUtils.sendCaptchaCode(msgVo); |
... | ... | @@ -50,6 +54,7 @@ public class CaptchaController { |
50 | 54 | * @return 查询结果 |
51 | 55 | */ |
52 | 56 | @AnonymousAccess |
57 | + @ApiOperation("获取图片验证码") | |
53 | 58 | @PostMapping("/get_img_captcha_code") |
54 | 59 | public ServerResult getImgCaptchaCode() { |
55 | 60 | // 算术类型 https://gitee.com/whvse/EasyCaptcha | ... | ... |
src/main/java/com/order/erp/controller/IndexController.java
... | ... | @@ -7,6 +7,8 @@ import com.order.erp.service.order.OrderBaseInfoService; |
7 | 7 | import com.order.erp.service.order.OrderCompletionReportService; |
8 | 8 | import com.order.erp.service.order.OrderInspectionStageService; |
9 | 9 | import com.order.erp.service.order.OrderProfitAnalysisService; |
10 | +import io.swagger.annotations.Api; | |
11 | +import io.swagger.annotations.ApiOperation; | |
10 | 12 | import org.springframework.web.bind.annotation.GetMapping; |
11 | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
12 | 14 | import org.springframework.web.bind.annotation.RestController; |
... | ... | @@ -22,6 +24,7 @@ import java.util.Map; |
22 | 24 | * @description 首页 |
23 | 25 | * @date 2023/10/23 16:44:55 |
24 | 26 | */ |
27 | +@Api(tags = "首页") | |
25 | 28 | @RestController |
26 | 29 | @RequestMapping("/order/erp/index") |
27 | 30 | public class IndexController { |
... | ... | @@ -39,6 +42,7 @@ public class IndexController { |
39 | 42 | OrderCompletionReportService orderCompletionReportService; |
40 | 43 | |
41 | 44 | @GetMapping("/data") |
45 | + @ApiOperation("首页统计数据") | |
42 | 46 | public ServerResult getData(){ |
43 | 47 | //订单总完成数 |
44 | 48 | long orderTotalFinished = orderBaseInfoService.countByOrderStatus(OrderStatusEnum.ORDER_FINISH.getStatus()); |
... | ... | @@ -73,6 +77,7 @@ public class IndexController { |
73 | 77 | } |
74 | 78 | |
75 | 79 | @GetMapping("/chartData") |
80 | + @ApiOperation("首页订单趋势") | |
76 | 81 | public ServerResult getChartData(){ |
77 | 82 | //订单趋势数据 |
78 | 83 | List<Map<String,Integer>> chartData = orderBaseInfoService.countDaysOrder(); | ... | ... |
src/main/java/com/order/erp/controller/LocalStorageController.java
... | ... | @@ -3,6 +3,7 @@ package com.order.erp.controller; |
3 | 3 | import com.order.erp.common.annotation.AnonymousAccess; |
4 | 4 | import com.order.erp.common.constant.ServerResult; |
5 | 5 | import com.order.erp.service.LocalStorageService; |
6 | +import io.swagger.annotations.Api; | |
6 | 7 | import io.swagger.annotations.ApiOperation; |
7 | 8 | import org.springframework.web.bind.annotation.PostMapping; |
8 | 9 | import org.springframework.web.bind.annotation.RequestMapping; |
... | ... | @@ -16,6 +17,7 @@ import javax.annotation.Resource; |
16 | 17 | * |
17 | 18 | */ |
18 | 19 | @RestController |
20 | +@Api(tags = "文件上传") | |
19 | 21 | @RequestMapping("/api/localStorage") |
20 | 22 | public class LocalStorageController { |
21 | 23 | ... | ... |
src/main/java/com/order/erp/controller/LoginController.java
... | ... | @@ -7,6 +7,7 @@ import com.order.erp.log.Log; |
7 | 7 | import com.order.erp.security.TokenProvider; |
8 | 8 | import com.order.erp.security.service.OnlineUserService; |
9 | 9 | import com.order.erp.service.admin.AdminUserService; |
10 | +import io.swagger.annotations.ApiOperation; | |
10 | 11 | import org.springframework.validation.annotation.Validated; |
11 | 12 | import org.springframework.web.bind.annotation.PostMapping; |
12 | 13 | import org.springframework.web.bind.annotation.RequestBody; |
... | ... | @@ -37,6 +38,7 @@ public class LoginController { |
37 | 38 | * @return 查询结果 |
38 | 39 | */ |
39 | 40 | @AnonymousAccess |
41 | + @ApiOperation("手机注册") | |
40 | 42 | @PostMapping("/phone_register") |
41 | 43 | public ServerResult phoneRegister(@RequestBody @Validated AdminUserRegisterVO registerVO) { |
42 | 44 | return userService.phoneRegister(registerVO); |
... | ... | @@ -49,6 +51,7 @@ public class LoginController { |
49 | 51 | * @return 查询结果 |
50 | 52 | */ |
51 | 53 | @AnonymousAccess |
54 | + @ApiOperation("手机登录") | |
52 | 55 | @PostMapping("/login_by_phone") |
53 | 56 | public ServerResult loginByPhone(@RequestBody @Validated AdminUserLoginByPhoneVO loginByPhoneVO) { |
54 | 57 | return userService.loginByPhone(loginByPhoneVO); |
... | ... | @@ -62,6 +65,7 @@ public class LoginController { |
62 | 65 | */ |
63 | 66 | @AnonymousAccess |
64 | 67 | @Log("用户登录") |
68 | + @ApiOperation("用户登录") | |
65 | 69 | @PostMapping("/login_by_pwd") |
66 | 70 | public ServerResult loginByPwd(@RequestBody @Validated AdminUserLoginByPwdVO loginByPwdVO) { |
67 | 71 | return userService.loginByPwd(loginByPwdVO); |
... | ... | @@ -86,6 +90,7 @@ public class LoginController { |
86 | 90 | * @return 查询结果 |
87 | 91 | */ |
88 | 92 | @AnonymousAccess |
93 | + @ApiOperation("用户登录") | |
89 | 94 | @PostMapping("/password_modify") |
90 | 95 | public ServerResult passwordModify(@RequestBody @Validated AdminUserModifyPwdVO modifyPwdVO) { |
91 | 96 | return userService.passwordModify(modifyPwdVO); |
... | ... | @@ -98,6 +103,7 @@ public class LoginController { |
98 | 103 | * @return 查询结果 |
99 | 104 | */ |
100 | 105 | @AnonymousAccess |
106 | + @ApiOperation("退出登录") | |
101 | 107 | @PostMapping("/login_out") |
102 | 108 | public ServerResult loginOut(HttpServletRequest request) { |
103 | 109 | onlineUserService.logout(tokenProvider.getToken(request)); | ... | ... |
src/main/java/com/order/erp/controller/OrderAuditLogController.java
... | ... | @@ -4,6 +4,8 @@ import com.order.erp.common.annotation.AnonymousAccess; |
4 | 4 | import com.order.erp.common.constant.ServerResult; |
5 | 5 | import com.order.erp.domain.vo.order.OrderAuditLogQueryVO; |
6 | 6 | import com.order.erp.service.order.OrderAuditLogService; |
7 | +import io.swagger.annotations.Api; | |
8 | +import io.swagger.annotations.ApiOperation; | |
7 | 9 | import org.springframework.validation.annotation.Validated; |
8 | 10 | import org.springframework.web.bind.annotation.PostMapping; |
9 | 11 | import org.springframework.web.bind.annotation.RequestBody; |
... | ... | @@ -18,6 +20,7 @@ import javax.annotation.Resource; |
18 | 20 | * @author makejava |
19 | 21 | * @since 2023-09-08 15:26:41 |
20 | 22 | */ |
23 | +@Api(tags = "用户订单审批日志") | |
21 | 24 | @RestController |
22 | 25 | @RequestMapping("/order/erp/audit/log") |
23 | 26 | public class OrderAuditLogController { |
... | ... | @@ -34,6 +37,7 @@ public class OrderAuditLogController { |
34 | 37 | * @return 查询结果 |
35 | 38 | */ |
36 | 39 | @PostMapping("/list") |
40 | + @ApiOperation("分页查询") | |
37 | 41 | @AnonymousAccess |
38 | 42 | public ServerResult list(@RequestBody @Validated OrderAuditLogQueryVO orderAuditLogQueryVO) { |
39 | 43 | return orderAuditLogService.list(orderAuditLogQueryVO); |
... | ... | @@ -46,6 +50,7 @@ public class OrderAuditLogController { |
46 | 50 | * @return 单条数据 |
47 | 51 | */ |
48 | 52 | @PostMapping("/query_by_id") |
53 | + @ApiOperation("通过主键查询单条数据") | |
49 | 54 | @AnonymousAccess |
50 | 55 | public ServerResult queryById(@RequestBody OrderAuditLogQueryVO orderAuditLogQueryVO) { |
51 | 56 | return orderAuditLogService.queryById(orderAuditLogQueryVO); | ... | ... |
src/main/java/com/order/erp/controller/OrderController.java
... | ... | @@ -5,6 +5,8 @@ import com.order.erp.common.constant.ServerResult; |
5 | 5 | import com.order.erp.common.excel4j.exceptions.Excel4JException; |
6 | 6 | import com.order.erp.domain.vo.order.*; |
7 | 7 | import com.order.erp.service.order.OrderBaseInfoService; |
8 | +import io.swagger.annotations.Api; | |
9 | +import io.swagger.annotations.ApiOperation; | |
8 | 10 | import org.springframework.validation.annotation.Validated; |
9 | 11 | import org.springframework.web.bind.annotation.PostMapping; |
10 | 12 | import org.springframework.web.bind.annotation.RequestBody; |
... | ... | @@ -21,6 +23,7 @@ import java.io.IOException; |
21 | 23 | * @author makejava |
22 | 24 | * @since 2023-09-08 15:26:43 |
23 | 25 | */ |
26 | +@Api(tags = "订单管理") | |
24 | 27 | @RestController |
25 | 28 | @RequestMapping("/order/erp/order") |
26 | 29 | public class OrderController { |
... | ... | @@ -37,6 +40,7 @@ public class OrderController { |
37 | 40 | * @return 查询结果 |
38 | 41 | */ |
39 | 42 | @PostMapping("/list_by_page") |
43 | + @ApiOperation("分页查询") | |
40 | 44 | @AnonymousAccess |
41 | 45 | public ServerResult listByPage(@RequestBody @Validated OrderBaseInfoQueryVO orderBaseInfoQueryVO) { |
42 | 46 | return orderBaseInfoService.listByPage(orderBaseInfoQueryVO); |
... | ... | @@ -49,6 +53,7 @@ public class OrderController { |
49 | 53 | * @return 查询结果 |
50 | 54 | */ |
51 | 55 | @PostMapping("/export") |
56 | + @ApiOperation("导出订单") | |
52 | 57 | @AnonymousAccess |
53 | 58 | public ServerResult export(HttpServletResponse response, @RequestBody @Validated OrderBaseInfoQueryVO orderBaseInfoQueryVO) throws IOException, Excel4JException { |
54 | 59 | return orderBaseInfoService.export(response, orderBaseInfoQueryVO); |
... | ... | @@ -72,6 +77,7 @@ public class OrderController { |
72 | 77 | * @return 新增结果 |
73 | 78 | */ |
74 | 79 | @PostMapping("/add") |
80 | + @ApiOperation("新增数据") | |
75 | 81 | @AnonymousAccess |
76 | 82 | public ServerResult add(@RequestBody OrderAddVO orderAddVO) { |
77 | 83 | return orderBaseInfoService.add(orderAddVO); |
... | ... | @@ -84,6 +90,7 @@ public class OrderController { |
84 | 90 | * @return 查询结果 |
85 | 91 | */ |
86 | 92 | @PostMapping("/field_unlock_apply") |
93 | + @ApiOperation("字段解锁申请") | |
87 | 94 | @AnonymousAccess |
88 | 95 | public ServerResult fieldUnlockApply(@RequestBody @Validated OrderUnlockFieldApplyVO fieldVO) { |
89 | 96 | return orderBaseInfoService.fieldUnlockApply(fieldVO); |
... | ... | @@ -96,6 +103,7 @@ public class OrderController { |
96 | 103 | * @param updateVO 数据VO |
97 | 104 | * @return 编辑结果 |
98 | 105 | */ |
106 | + @ApiOperation("编辑数据") | |
99 | 107 | @PostMapping("/edit") |
100 | 108 | public ServerResult edit(@RequestBody OrderUpdateVO updateVO) { |
101 | 109 | return orderBaseInfoService.edit(updateVO); |
... | ... | @@ -107,6 +115,7 @@ public class OrderController { |
107 | 115 | * @param orderBaseInfoQueryVO 查询条件 |
108 | 116 | * @return 删除是否成功 |
109 | 117 | */ |
118 | + @ApiOperation("删除数据") | |
110 | 119 | @PostMapping("/delete_by_id") |
111 | 120 | public ServerResult deleteById(@RequestBody OrderBaseInfoQueryVO orderBaseInfoQueryVO) { |
112 | 121 | return orderBaseInfoService.deleteById(orderBaseInfoQueryVO); | ... | ... |
src/main/java/com/order/erp/controller/OrderFieldLockApplyController.java
... | ... | @@ -5,6 +5,8 @@ import com.order.erp.common.constant.ServerResult; |
5 | 5 | import com.order.erp.domain.vo.order.OrderFieldLockApplyQueryVO; |
6 | 6 | import com.order.erp.domain.vo.order.OrderFieldLockApplyVO; |
7 | 7 | import com.order.erp.service.order.OrderFieldLockApplyService; |
8 | +import io.swagger.annotations.Api; | |
9 | +import io.swagger.annotations.ApiOperation; | |
8 | 10 | import org.springframework.validation.annotation.Validated; |
9 | 11 | import org.springframework.web.bind.annotation.PostMapping; |
10 | 12 | import org.springframework.web.bind.annotation.RequestBody; |
... | ... | @@ -19,6 +21,7 @@ import javax.annotation.Resource; |
19 | 21 | * @author makejava |
20 | 22 | * @since 2023-09-08 15:26:44 |
21 | 23 | */ |
24 | +@Api(tags = "用户订单-字段锁定申请(忽略)") | |
22 | 25 | @RestController |
23 | 26 | @RequestMapping("/order/erp/apply") |
24 | 27 | public class OrderFieldLockApplyController { |
... | ... | @@ -35,58 +38,11 @@ public class OrderFieldLockApplyController { |
35 | 38 | * @return 查询结果 |
36 | 39 | */ |
37 | 40 | @PostMapping("/list") |
41 | + @ApiOperation("分页查询") | |
38 | 42 | @AnonymousAccess |
39 | 43 | public ServerResult list(@RequestBody @Validated OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO) { |
40 | 44 | return orderFieldLockApplyService.list(orderFieldLockApplyQueryVO); |
41 | 45 | } |
42 | 46 | |
43 | - /** | |
44 | - * 通过主键查询单条数据 | |
45 | - * | |
46 | - * @param orderFieldLockApplyQueryVO 查询条件 | |
47 | - * @return 单条数据 | |
48 | - */ | |
49 | - @PostMapping("/query_by_id") | |
50 | - @AnonymousAccess | |
51 | - public ServerResult queryById(@RequestBody OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO) { | |
52 | - return orderFieldLockApplyService.queryById(orderFieldLockApplyQueryVO); | |
53 | - } | |
54 | - | |
55 | - /** | |
56 | - * 新增数据 | |
57 | - * | |
58 | - * @param orderFieldLockApplyVO 数据VO | |
59 | - * @return 新增结果 | |
60 | - */ | |
61 | - @PostMapping("/add") | |
62 | - @AnonymousAccess | |
63 | - public ServerResult add(@RequestBody OrderFieldLockApplyVO orderFieldLockApplyVO) { | |
64 | - return orderFieldLockApplyService.add(orderFieldLockApplyVO); | |
65 | - } | |
66 | - | |
67 | - /** | |
68 | - * 编辑数据 | |
69 | - * | |
70 | - * @param orderFieldLockApplyVO 数据VO | |
71 | - * @return 编辑结果 | |
72 | - */ | |
73 | - @PostMapping("/edit") | |
74 | - @AnonymousAccess | |
75 | - public ServerResult edit(@RequestBody OrderFieldLockApplyVO orderFieldLockApplyVO) { | |
76 | - return orderFieldLockApplyService.edit(orderFieldLockApplyVO); | |
77 | - } | |
78 | - | |
79 | - /** | |
80 | - * 删除数据 | |
81 | - * | |
82 | - * @param orderFieldLockApplyQueryVO 查询条件 | |
83 | - * @return 删除是否成功 | |
84 | - */ | |
85 | - @PostMapping("/delete_by_id") | |
86 | - @AnonymousAccess | |
87 | - public ServerResult deleteById(@RequestBody OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO) { | |
88 | - return orderFieldLockApplyService.deleteById(orderFieldLockApplyQueryVO); | |
89 | - } | |
90 | - | |
91 | 47 | } |
92 | 48 | ... | ... |
src/main/java/com/order/erp/controller/OrderOptLogController.java
1 | 1 | package com.order.erp.controller; |
2 | 2 | |
3 | +import io.swagger.annotations.Api; | |
3 | 4 | import org.springframework.web.bind.annotation.RequestMapping; |
4 | 5 | import org.springframework.web.bind.annotation.RestController; |
5 | 6 | |
... | ... | @@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController; |
9 | 10 | * @author makejava |
10 | 11 | * @since 2023-09-08 15:26:46 |
11 | 12 | */ |
13 | +@Api(tags = "(忽略)") | |
12 | 14 | @RestController |
13 | 15 | @RequestMapping("/gwms/xxx") |
14 | 16 | public class OrderOptLogController { | ... | ... |
src/main/java/com/order/erp/controller/OrderProfitController.java
1 | 1 | package com.order.erp.controller; |
2 | 2 | |
3 | +import com.order.erp.common.annotation.AnonymousAccess; | |
3 | 4 | import com.order.erp.common.constant.ServerResult; |
4 | 5 | import com.order.erp.domain.dto.order.OrderProfitAnalysisDO; |
5 | 6 | import com.order.erp.service.order.OrderProfitAnalysisService; |
7 | +import io.swagger.annotations.Api; | |
8 | +import io.swagger.annotations.ApiOperation; | |
6 | 9 | import org.springframework.web.bind.annotation.PostMapping; |
7 | 10 | import org.springframework.web.bind.annotation.RequestBody; |
8 | 11 | import org.springframework.web.bind.annotation.RequestMapping; |
... | ... | @@ -19,6 +22,7 @@ import java.util.Map; |
19 | 22 | * @description 订单利润表控制层 |
20 | 23 | * @date 2023/10/23 11:48:36 |
21 | 24 | */ |
25 | +@Api(tags = "订单利润计算") | |
22 | 26 | @RestController |
23 | 27 | @RequestMapping("/order/erp/profit") |
24 | 28 | public class OrderProfitController { |
... | ... | @@ -27,6 +31,8 @@ public class OrderProfitController { |
27 | 31 | OrderProfitAnalysisService orderProfitAnalysisService; |
28 | 32 | |
29 | 33 | @PostMapping("/analysis") |
34 | + @AnonymousAccess | |
35 | + @ApiOperation("计算利润率") | |
30 | 36 | public ServerResult analysis(@RequestBody Map<String,List<Long>> body){ |
31 | 37 | List<Long> orderIds = body.get("orderIds"); |
32 | 38 | if (orderIds==null||orderIds.size()<=0){ | ... | ... |
src/main/java/com/order/erp/controller/SysLogController.java
... | ... | @@ -5,6 +5,8 @@ import com.order.erp.common.constant.ServerResult; |
5 | 5 | import com.order.erp.domain.vo.SysLogQueryVO; |
6 | 6 | import com.order.erp.domain.vo.SysLogVO; |
7 | 7 | import com.order.erp.service.SysLogService; |
8 | +import io.swagger.annotations.Api; | |
9 | +import io.swagger.annotations.ApiOperation; | |
8 | 10 | import org.springframework.validation.annotation.Validated; |
9 | 11 | import org.springframework.web.bind.annotation.PostMapping; |
10 | 12 | import org.springframework.web.bind.annotation.RequestBody; |
... | ... | @@ -19,6 +21,7 @@ import javax.annotation.Resource; |
19 | 21 | * @author makejava |
20 | 22 | * @since 2023-09-06 16:24:52 |
21 | 23 | */ |
24 | +@Api(tags = "系统日志") | |
22 | 25 | @RestController |
23 | 26 | @RequestMapping("/order/erp/logs") |
24 | 27 | public class SysLogController { |
... | ... | @@ -36,57 +39,10 @@ public class SysLogController { |
36 | 39 | */ |
37 | 40 | @PostMapping("/list") |
38 | 41 | @AnonymousAccess |
42 | + @ApiOperation("分页查询") | |
39 | 43 | public ServerResult list(@RequestBody @Validated SysLogQueryVO sysLogQueryVO) { |
40 | 44 | return sysLogService.list(sysLogQueryVO); |
41 | 45 | } |
42 | 46 | |
43 | - /** | |
44 | - * 通过主键查询单条数据 | |
45 | - * | |
46 | - * @param sysLogQueryVO 查询条件 | |
47 | - * @return 单条数据 | |
48 | - */ | |
49 | - @PostMapping("/query_by_id") | |
50 | - @AnonymousAccess | |
51 | - public ServerResult queryById(@RequestBody SysLogQueryVO sysLogQueryVO) { | |
52 | - return sysLogService.queryById(sysLogQueryVO); | |
53 | - } | |
54 | - | |
55 | - /** | |
56 | - * 新增数据 | |
57 | - * | |
58 | - * @param sysLogVO 数据VO | |
59 | - * @return 新增结果 | |
60 | - */ | |
61 | - @PostMapping("/add") | |
62 | - @AnonymousAccess | |
63 | - public ServerResult add(@RequestBody SysLogVO sysLogVO) { | |
64 | - return sysLogService.add(sysLogVO); | |
65 | - } | |
66 | - | |
67 | - /** | |
68 | - * 编辑数据 | |
69 | - * | |
70 | - * @param sysLogVO 数据VO | |
71 | - * @return 编辑结果 | |
72 | - */ | |
73 | - @PostMapping("/edit") | |
74 | - @AnonymousAccess | |
75 | - public ServerResult edit(@RequestBody SysLogVO sysLogVO) { | |
76 | - return sysLogService.edit(sysLogVO); | |
77 | - } | |
78 | - | |
79 | - /** | |
80 | - * 删除数据 | |
81 | - * | |
82 | - * @param sysLogQueryVO 查询条件 | |
83 | - * @return 删除是否成功 | |
84 | - */ | |
85 | - @PostMapping("/delete_by_id") | |
86 | - @AnonymousAccess | |
87 | - public ServerResult deleteById(@RequestBody SysLogQueryVO sysLogQueryVO) { | |
88 | - return sysLogService.deleteById(sysLogQueryVO); | |
89 | - } | |
90 | - | |
91 | 47 | } |
92 | 48 | ... | ... |