接口文档整理

This commit is contained in:
hupeng
2019-12-29 13:50:54 +08:00
parent 37fd174b7b
commit 16461bd97a
38 changed files with 280 additions and 293 deletions

View File

@ -125,6 +125,11 @@
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>1.9.3</version>
</dependency>
<!--Mysql依赖包-->
<dependency>

View File

@ -58,31 +58,6 @@
<version>2.0</version>
</dependency>
<!-- quartz -->
<!-- <dependency>-->
<!-- <groupId>org.quartz-scheduler</groupId>-->
<!-- <artifactId>quartz</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.springfox</groupId>-->
<!-- <artifactId>springfox-swagger2</artifactId>-->
<!-- <version>2.9.2</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.swagger</groupId>-->
<!-- <artifactId>swagger-annotations</artifactId>-->
<!-- <version>1.5.21</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.swagger</groupId>-->
<!-- <artifactId>swagger-models</artifactId>-->
<!-- <version>1.5.21</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>p6spy</groupId>
<artifactId>p6spy</artifactId>
@ -93,12 +68,6 @@
<artifactId>core</artifactId>
<version>3.3.3</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>redis.clients</groupId>-->
<!-- <artifactId>jedis</artifactId>-->
<!-- <version>3.1.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>

View File

@ -1,5 +1,6 @@
package co.yixiang.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
@ -19,9 +20,13 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfiguration {
@Value("${swagger.enabled}")
private Boolean enabled;
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.enable(enabled)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("co.yixiang.modules"))
@ -31,11 +36,11 @@ public class SwaggerConfiguration {
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Yshop商城API")
.description("Yshop商城API")
.termsOfServiceUrl("http://localhost:8009/")
.title("yshop商城移动端API")
.description("yshop商城移动端API")
.termsOfServiceUrl("http://localhost:8009/api")
.contact("610796224@qq.com")
.version("1.0")
.version("1.6")
.build();
}
}

View File

@ -1,6 +1,8 @@
package co.yixiang.modules.monitor.rest;
import co.yixiang.annotation.Limit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -13,6 +15,7 @@ import java.util.concurrent.atomic.AtomicInteger;
*/
@RestController
@RequestMapping("api")
@Api(value = "接口限流测试", tags = "接口限流测试", description = "接口限流测试")
public class LimitController {
private static final AtomicInteger ATOMIC_INTEGER = new AtomicInteger();
@ -21,6 +24,7 @@ public class LimitController {
*/
@Limit(key = "test", period = 60, count = 10, name = "testLimit", prefix = "limit")
@GetMapping("/limit")
@ApiOperation(value = "测试示例",notes = "测试示例")
public int testLimit() {
return ATOMIC_INTEGER.incrementAndGet();
}

View File

@ -1,47 +0,0 @@
package co.yixiang.modules.monitor.rest;
import co.yixiang.modules.monitor.domain.vo.RedisVo;
import co.yixiang.modules.monitor.service.RedisService;
import co.yixiang.aop.log.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
/**
* @author Zheng Jie
* @date 2018-12-10
*/
@RestController
@RequestMapping("api")
public class RedisController {
@Autowired
private RedisService redisService;
@Log("查询Redis缓存")
@GetMapping(value = "/redis")
@PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_SELECT')")
public ResponseEntity getRedis(String key, Pageable pageable){
return new ResponseEntity(redisService.findByKey(key,pageable), HttpStatus.OK);
}
@Log("删除Redis缓存")
@DeleteMapping(value = "/redis")
@PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_DELETE')")
public ResponseEntity delete(@RequestBody RedisVo resources){
redisService.delete(resources.getKey());
return new ResponseEntity(HttpStatus.OK);
}
@Log("清空Redis缓存")
@DeleteMapping(value = "/redis/all")
@PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_DELETE')")
public ResponseEntity deleteAll(){
redisService.flushdb();
return new ResponseEntity(HttpStatus.OK);
}
}

View File

@ -1,39 +0,0 @@
package co.yixiang.modules.monitor.rest;
import co.yixiang.modules.monitor.service.VisitsService;
import co.yixiang.utils.RequestHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author Zheng Jie
* @date 2018-12-13
*/
@RestController
@RequestMapping("api")
public class VisitsController {
@Autowired
private VisitsService visitsService;
@PostMapping(value = "/visits")
public ResponseEntity create(){
visitsService.count(RequestHolder.getHttpServletRequest());
return new ResponseEntity(HttpStatus.CREATED);
}
@GetMapping(value = "/visits")
public ResponseEntity get(){
return new ResponseEntity(visitsService.get(),HttpStatus.OK);
}
@GetMapping(value = "/visits/chartData")
public ResponseEntity getChartData(){
return new ResponseEntity(visitsService.getChartData(),HttpStatus.OK);
}
}

View File

@ -17,6 +17,7 @@ import co.yixiang.utils.EncryptUtils;
import co.yixiang.utils.OrderUtil;
import co.yixiang.utils.SecurityUtils;
import com.vdurmont.emoji.EmojiParser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import co.yixiang.aop.log.Log;
@ -45,6 +46,7 @@ import java.util.Map;
*/
@Slf4j
@RestController
@Api(value = "H5认证模块", tags = "H5认证模块", description = "H5认证模块")
public class AuthenticationController extends BaseController {
@Value("${jwt.header}")
@ -71,6 +73,7 @@ public class AuthenticationController extends BaseController {
*/
@Log("用户登录")
@PostMapping(value = "${jwt.auth.path}")
@ApiOperation(value = "用户登录",notes = "用户登录")
public ApiResult<Map<String,String>> login(@Validated @RequestBody AuthorizationUser authorizationUser){
final JwtUser jwtUser = (JwtUser) userDetailsService.loadUserByUsername(authorizationUser.getAccount());
@ -173,6 +176,7 @@ public class AuthenticationController extends BaseController {
* @return
*/
@PostMapping(value = "/auth/logout")
@ApiOperation(value = "退出登录",notes = "退出登录")
public ApiResult logout(){
return ApiResult.ok("退出成功");
}

View File

@ -26,7 +26,7 @@ import javax.validation.Valid;
*/
@Slf4j
@RestController
@Api("商品分类表 API")
@Api(value = "商品分类", tags = "商品分类", description = "商品分类")
public class StoreCategoryController extends BaseController {
@Autowired

View File

@ -23,6 +23,8 @@ import co.yixiang.mp.utils.JsonUtils;
import co.yixiang.utils.EncryptUtils;
import co.yixiang.utils.OrderUtil;
import co.yixiang.utils.RedisUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
@ -50,6 +52,7 @@ import java.util.concurrent.locks.Lock;
*/
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(value = "微信小程序", tags = "微信小程序", description = "微信小程序")
public class WxMaUserController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final WxMaService wxMaService;
@ -66,6 +69,7 @@ public class WxMaUserController {
* 小程序登陆接口
*/
@PostMapping("/wechat/mp_auth")
@ApiOperation(value = "小程序登陆",notes = "小程序登陆")
public ApiResult<Object> login(@RequestParam(value = "code") String code,
@RequestParam(value = "spread") String spread,
@RequestParam(value = "encryptedData") String encryptedData,

View File

@ -21,7 +21,7 @@ import io.swagger.annotations.*;
* @author xuwenbo
* @date 2019-12-22
*/
@Api(tags = "YxStoreBargain管理")
@Api(tags = "砍价管理")
@RestController
@RequestMapping("api")
public class YxStoreBargainController {
@ -29,8 +29,8 @@ public class YxStoreBargainController {
@Autowired
private YxStoreBargainService yxStoreBargainService;
@Log("查询YxStoreBargain")
@ApiOperation(value = "查询YxStoreBargain")
@Log("查询砍价")
@ApiOperation(value = "查询砍价")
@GetMapping(value = "/yxStoreBargain")
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_SELECT')")
public ResponseEntity getYxStoreBargains(YxStoreBargainQueryCriteria criteria, Pageable pageable){
@ -39,8 +39,8 @@ public class YxStoreBargainController {
@Log("修改YxStoreBargain")
@ApiOperation(value = "修改YxStoreBargain")
@Log("修改砍价")
@ApiOperation(value = "修改砍价")
@PutMapping(value = "/yxStoreBargain")
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxStoreBargain resources){
@ -62,8 +62,8 @@ public class YxStoreBargainController {
}
}
@Log("删除YxStoreBargain")
@ApiOperation(value = "删除YxStoreBargain")
@Log("删除砍价")
@ApiOperation(value = "删除砍价")
@DeleteMapping(value = "/yxStoreBargain/{id}")
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){

View File

@ -17,7 +17,7 @@ import io.swagger.annotations.*;
* @author hupeng
* @date 2019-11-09
*/
@Api(tags = "YxStoreCouponIssueUser管理")
@Api(tags = "优惠券前台用户领取记录管理")
@RestController
@RequestMapping("api")
public class YxStoreCouponIssueUserController {
@ -25,24 +25,24 @@ public class YxStoreCouponIssueUserController {
@Autowired
private YxStoreCouponIssueUserService yxStoreCouponIssueUserService;
@Log("查询YxStoreCouponIssueUser")
@ApiOperation(value = "查询YxStoreCouponIssueUser")
@Log("查询")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxStoreCouponIssueUser")
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_SELECT')")
public ResponseEntity getYxStoreCouponIssueUsers(YxStoreCouponIssueUserQueryCriteria criteria, Pageable pageable){
return new ResponseEntity(yxStoreCouponIssueUserService.queryAll(criteria,pageable),HttpStatus.OK);
}
@Log("新增YxStoreCouponIssueUser")
@ApiOperation(value = "新增YxStoreCouponIssueUser")
@Log("新增")
@ApiOperation(value = "新增")
@PostMapping(value = "/yxStoreCouponIssueUser")
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_CREATE')")
public ResponseEntity create(@Validated @RequestBody YxStoreCouponIssueUser resources){
return new ResponseEntity(yxStoreCouponIssueUserService.create(resources),HttpStatus.CREATED);
}
@Log("修改YxStoreCouponIssueUser")
@ApiOperation(value = "修改YxStoreCouponIssueUser")
@Log("修改")
@ApiOperation(value = "修改")
@PutMapping(value = "/yxStoreCouponIssueUser")
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxStoreCouponIssueUser resources){
@ -50,8 +50,8 @@ public class YxStoreCouponIssueUserController {
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@Log("删除YxStoreCouponIssueUser")
@ApiOperation(value = "删除YxStoreCouponIssueUser")
@Log("删除")
@ApiOperation(value = "删除")
@DeleteMapping(value = "/yxStoreCouponIssueUser/{id}")
@PreAuthorize("hasAnyRole('ADMIN','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){

View File

@ -1,61 +1,61 @@
package co.yixiang.modules.activity.rest;
import co.yixiang.aop.log.Log;
import co.yixiang.modules.activity.domain.YxStoreVisit;
import co.yixiang.modules.activity.service.YxStoreVisitService;
import co.yixiang.modules.activity.service.dto.YxStoreVisitQueryCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
/**
* @author hupeng
* @date 2019-11-18
*/
@Api(tags = "YxStoreVisit管理")
@RestController
@RequestMapping("api")
public class YxStoreVisitController {
@Autowired
private YxStoreVisitService yxStoreVisitService;
@Log("查询YxStoreVisit")
@ApiOperation(value = "查询YxStoreVisit")
@GetMapping(value = "/yxStoreVisit")
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREVISIT_ALL','YXSTOREVISIT_SELECT')")
public ResponseEntity getYxStoreVisits(YxStoreVisitQueryCriteria criteria, Pageable pageable){
return new ResponseEntity(yxStoreVisitService.queryAll(criteria,pageable),HttpStatus.OK);
}
@Log("新增YxStoreVisit")
@ApiOperation(value = "新增YxStoreVisit")
@PostMapping(value = "/yxStoreVisit")
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREVISIT_ALL','YXSTOREVISIT_CREATE')")
public ResponseEntity create(@Validated @RequestBody YxStoreVisit resources){
return new ResponseEntity(yxStoreVisitService.create(resources),HttpStatus.CREATED);
}
@Log("修改YxStoreVisit")
@ApiOperation(value = "修改YxStoreVisit")
@PutMapping(value = "/yxStoreVisit")
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREVISIT_ALL','YXSTOREVISIT_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxStoreVisit resources){
yxStoreVisitService.update(resources);
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@Log("删除YxStoreVisit")
@ApiOperation(value = "删除YxStoreVisit")
@DeleteMapping(value = "/yxStoreVisit/{id}")
@PreAuthorize("hasAnyRole('ADMIN','YXSTOREVISIT_ALL','YXSTOREVISIT_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){
yxStoreVisitService.delete(id);
return new ResponseEntity(HttpStatus.OK);
}
}
//package co.yixiang.modules.activity.rest;
//
//import co.yixiang.aop.log.Log;
//import co.yixiang.modules.activity.domain.YxStoreVisit;
//import co.yixiang.modules.activity.service.YxStoreVisitService;
//import co.yixiang.modules.activity.service.dto.YxStoreVisitQueryCriteria;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Pageable;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.ResponseEntity;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//import io.swagger.annotations.*;
//
///**
//* @author hupeng
//* @date 2019-11-18
//*/
//@Api(tags = "fang管理")
//@RestController
//@RequestMapping("api")
//public class YxStoreVisitController {
//
// @Autowired
// private YxStoreVisitService yxStoreVisitService;
//
// @Log("查询YxStoreVisit")
// @ApiOperation(value = "查询YxStoreVisit")
// @GetMapping(value = "/yxStoreVisit")
// @PreAuthorize("hasAnyRole('ADMIN','YXSTOREVISIT_ALL','YXSTOREVISIT_SELECT')")
// public ResponseEntity getYxStoreVisits(YxStoreVisitQueryCriteria criteria, Pageable pageable){
// return new ResponseEntity(yxStoreVisitService.queryAll(criteria,pageable),HttpStatus.OK);
// }
//
// @Log("新增YxStoreVisit")
// @ApiOperation(value = "新增YxStoreVisit")
// @PostMapping(value = "/yxStoreVisit")
// @PreAuthorize("hasAnyRole('ADMIN','YXSTOREVISIT_ALL','YXSTOREVISIT_CREATE')")
// public ResponseEntity create(@Validated @RequestBody YxStoreVisit resources){
// return new ResponseEntity(yxStoreVisitService.create(resources),HttpStatus.CREATED);
// }
//
// @Log("修改YxStoreVisit")
// @ApiOperation(value = "修改YxStoreVisit")
// @PutMapping(value = "/yxStoreVisit")
// @PreAuthorize("hasAnyRole('ADMIN','YXSTOREVISIT_ALL','YXSTOREVISIT_EDIT')")
// public ResponseEntity update(@Validated @RequestBody YxStoreVisit resources){
// yxStoreVisitService.update(resources);
// return new ResponseEntity(HttpStatus.NO_CONTENT);
// }
//
// @Log("删除YxStoreVisit")
// @ApiOperation(value = "删除YxStoreVisit")
// @DeleteMapping(value = "/yxStoreVisit/{id}")
// @PreAuthorize("hasAnyRole('ADMIN','YXSTOREVISIT_ALL','YXSTOREVISIT_DELETE')")
// public ResponseEntity delete(@PathVariable Integer id){
// yxStoreVisitService.delete(id);
// return new ResponseEntity(HttpStatus.OK);
// }
//}

View File

@ -26,7 +26,7 @@ import io.swagger.annotations.*;
* @author hupeng
* @date 2019-11-14
*/
@Api(tags = "YxUserExtract管理")
@Api(tags = "提现管理")
@RestController
@RequestMapping("api")
public class YxUserExtractController {
@ -40,8 +40,8 @@ public class YxUserExtractController {
@Autowired
private YxUserBillService yxUserBillService;
@Log("查询YxUserExtract")
@ApiOperation(value = "查询YxUserExtract")
@Log("查询")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxUserExtract")
@PreAuthorize("hasAnyRole('ADMIN','YXUSEREXTRACT_ALL','YXUSEREXTRACT_SELECT')")
public ResponseEntity getYxUserExtracts(YxUserExtractQueryCriteria criteria, Pageable pageable){
@ -51,7 +51,7 @@ public class YxUserExtractController {
@Log("修改")
@ApiOperation(value = "修改")
@ApiOperation(value = "修改审核")
@PutMapping(value = "/yxUserExtract")
@PreAuthorize("hasAnyRole('ADMIN','YXUSEREXTRACT_ALL','YXUSEREXTRACT_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxUserExtract resources){

View File

@ -19,7 +19,7 @@ import io.swagger.annotations.*;
* @author hupeng
* @date 2019-12-12
*/
@Api(tags = "YxExpress管理")
@Api(tags = "快递管理")
@RestController
@RequestMapping("api")
public class YxExpressController {
@ -27,16 +27,16 @@ public class YxExpressController {
@Autowired
private YxExpressService yxExpressService;
@Log("查询YxExpress")
@ApiOperation(value = "查询YxExpress")
@Log("查询快递")
@ApiOperation(value = "查询快递")
@GetMapping(value = "/yxExpress")
@PreAuthorize("hasAnyRole('ADMIN','YXEXPRESS_ALL','YXEXPRESS_SELECT')")
public ResponseEntity getYxExpresss(YxExpressQueryCriteria criteria, Pageable pageable){
return new ResponseEntity(yxExpressService.queryAll(criteria,pageable),HttpStatus.OK);
}
@Log("新增YxExpress")
@ApiOperation(value = "新增YxExpress")
@Log("新增快递")
@ApiOperation(value = "新增快递")
@PostMapping(value = "/yxExpress")
@PreAuthorize("hasAnyRole('ADMIN','YXEXPRESS_ALL','YXEXPRESS_CREATE')")
public ResponseEntity create(@Validated @RequestBody YxExpress resources){
@ -44,8 +44,8 @@ public class YxExpressController {
return new ResponseEntity(yxExpressService.create(resources),HttpStatus.CREATED);
}
@Log("修改YxExpress")
@ApiOperation(value = "修改YxExpress")
@Log("修改快递")
@ApiOperation(value = "修改快递")
@PutMapping(value = "/yxExpress")
@PreAuthorize("hasAnyRole('ADMIN','YXEXPRESS_ALL','YXEXPRESS_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxExpress resources){
@ -54,8 +54,8 @@ public class YxExpressController {
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@Log("删除YxExpress")
@ApiOperation(value = "删除YxExpress")
@Log("删除快递")
@ApiOperation(value = "删除快递")
@DeleteMapping(value = "/yxExpress/{id}")
@PreAuthorize("hasAnyRole('ADMIN','YXEXPRESS_ALL','YXEXPRESS_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){

View File

@ -20,7 +20,7 @@ import io.swagger.annotations.*;
* @author hupeng
* @date 2019-12-04
*/
@Api(tags = "YxSystemUserLevel管理")
@Api(tags = "用户等级管理")
@RestController
@RequestMapping("api")
public class YxSystemUserLevelController {
@ -46,8 +46,8 @@ public class YxSystemUserLevelController {
return new ResponseEntity(yxSystemUserLevelService.create(resources),HttpStatus.CREATED);
}
@Log("修改YxSystemUserLevel")
@ApiOperation(value = "修改YxSystemUserLevel")
@Log("修改")
@ApiOperation(value = "修改")
@PutMapping(value = "/yxSystemUserLevel")
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxSystemUserLevel resources){
@ -56,8 +56,8 @@ public class YxSystemUserLevelController {
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@Log("删除YxSystemUserLevel")
@ApiOperation(value = "删除YxSystemUserLevel")
@Log("删除")
@ApiOperation(value = "删除")
@DeleteMapping(value = "/yxSystemUserLevel/{id}")
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMUSERLEVEL_ALL','YXSYSTEMUSERLEVEL_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){

View File

@ -21,7 +21,7 @@ import io.swagger.annotations.*;
* @author hupeng
* @date 2019-12-04
*/
@Api(tags = "YxSystemUserTask管理")
@Api(tags = "用户任务管理")
@RestController
@RequestMapping("api")
public class YxSystemUserTaskController {
@ -29,8 +29,8 @@ public class YxSystemUserTaskController {
@Autowired
private YxSystemUserTaskService yxSystemUserTaskService;
@Log("查询YxSystemUserTask")
@ApiOperation(value = "查询YxSystemUserTask")
@Log("查询")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxSystemUserTask")
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_SELECT')")
public ResponseEntity getYxSystemUserTasks(YxSystemUserTaskQueryCriteria criteria,
@ -43,16 +43,16 @@ public class YxSystemUserTaskController {
HttpStatus.OK);
}
@Log("新增YxSystemUserTask")
@ApiOperation(value = "新增YxSystemUserTask")
@Log("新增")
@ApiOperation(value = "新增")
@PostMapping(value = "/yxSystemUserTask")
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_CREATE')")
public ResponseEntity create(@Validated @RequestBody YxSystemUserTask resources){
return new ResponseEntity(yxSystemUserTaskService.create(resources),HttpStatus.CREATED);
}
@Log("修改YxSystemUserTask")
@ApiOperation(value = "修改YxSystemUserTask")
@Log("修改")
@ApiOperation(value = "修改")
@PutMapping(value = "/yxSystemUserTask")
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxSystemUserTask resources){
@ -61,8 +61,8 @@ public class YxSystemUserTaskController {
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@Log("删除YxSystemUserTask")
@ApiOperation(value = "删除YxSystemUserTask")
@Log("删除")
@ApiOperation(value = "删除")
@DeleteMapping(value = "/yxSystemUserTask/{id}")
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMUSERTASK_ALL','YXSYSTEMUSERTASK_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){

View File

@ -17,7 +17,7 @@ import io.swagger.annotations.*;
* @author hupeng
* @date 2019-11-06
*/
@Api(tags = "YxUserBill管理")
@Api(tags = "用户账单管理")
@RestController
@RequestMapping("api")
public class YxUserBillController {
@ -25,8 +25,8 @@ public class YxUserBillController {
@Autowired
private YxUserBillService yxUserBillService;
@Log("查询YxUserBill")
@ApiOperation(value = "查询YxUserBill")
@Log("查询")
@ApiOperation(value = "查询")
@GetMapping(value = "/yxUserBill")
@PreAuthorize("hasAnyRole('ADMIN','YXUSERBILL_ALL','YXUSERBILL_SELECT')")
public ResponseEntity getYxUserBills(YxUserBillQueryCriteria criteria, Pageable pageable){

View File

@ -23,7 +23,7 @@ import io.swagger.annotations.*;
* @author hupeng
* @date 2019-10-10
*/
@Api(tags = "YxSystemConfig管理")
@Api(tags = "配置管理")
@RestController
@RequestMapping("api")
public class YxSystemConfigController {
@ -31,7 +31,7 @@ public class YxSystemConfigController {
@Autowired
private YxSystemConfigService yxSystemConfigService;
@Log("查询YxSystemConfig")
@Log("查询")
@ApiOperation(value = "查询YxSystemConfig")
@GetMapping(value = "/yxSystemConfig")
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_SELECT')")
@ -39,7 +39,7 @@ public class YxSystemConfigController {
return new ResponseEntity(yxSystemConfigService.queryAll(criteria,pageable),HttpStatus.OK);
}
@Log("新增YxSystemConfig")
@Log("新增或修改")
@ApiOperation(value = "新增YxSystemConfig")
@PostMapping(value = "/yxSystemConfig")
@PreAuthorize("hasAnyRole('ADMIN','YXSYSTEMCONFIG_ALL','YXSYSTEMCONFIG_CREATE')")

View File

@ -1,61 +1,61 @@
package co.yixiang.modules.wechat.rest;
import co.yixiang.aop.log.Log;
import co.yixiang.modules.wechat.domain.YxWechatUser;
import co.yixiang.modules.wechat.service.YxWechatUserService;
import co.yixiang.modules.wechat.service.dto.YxWechatUserQueryCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
/**
* @author hupeng
* @date 2019-12-13
*/
@Api(tags = "YxWechatUser管理")
@RestController
@RequestMapping("api")
public class YxWechatUserController {
@Autowired
private YxWechatUserService yxWechatUserService;
@Log("查询YxWechatUser")
@ApiOperation(value = "查询YxWechatUser")
@GetMapping(value = "/yxWechatUser")
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_SELECT')")
public ResponseEntity getYxWechatUsers(YxWechatUserQueryCriteria criteria, Pageable pageable){
return new ResponseEntity(yxWechatUserService.queryAll(criteria,pageable),HttpStatus.OK);
}
@Log("新增YxWechatUser")
@ApiOperation(value = "新增YxWechatUser")
@PostMapping(value = "/yxWechatUser")
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_CREATE')")
public ResponseEntity create(@Validated @RequestBody YxWechatUser resources){
return new ResponseEntity(yxWechatUserService.create(resources),HttpStatus.CREATED);
}
@Log("修改YxWechatUser")
@ApiOperation(value = "修改YxWechatUser")
@PutMapping(value = "/yxWechatUser")
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxWechatUser resources){
yxWechatUserService.update(resources);
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@Log("删除YxWechatUser")
@ApiOperation(value = "删除YxWechatUser")
@DeleteMapping(value = "/yxWechatUser/{uid}")
@PreAuthorize("hasAnyRole('ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_DELETE')")
public ResponseEntity delete(@PathVariable Integer uid){
yxWechatUserService.delete(uid);
return new ResponseEntity(HttpStatus.OK);
}
}
//package co.yixiang.modules.wechat.rest;
//
//import co.yixiang.aop.log.Log;
//import co.yixiang.modules.wechat.domain.YxWechatUser;
//import co.yixiang.modules.wechat.service.YxWechatUserService;
//import co.yixiang.modules.wechat.service.dto.YxWechatUserQueryCriteria;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Pageable;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.ResponseEntity;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//import io.swagger.annotations.*;
//
///**
//* @author hupeng
//* @date 2019-12-13
//*/
//@Api(tags = "YxWechatUser管理")
//@RestController
//@RequestMapping("api")
//public class YxWechatUserController {
//
// @Autowired
// private YxWechatUserService yxWechatUserService;
//
// @Log("查询YxWechatUser")
// @ApiOperation(value = "查询YxWechatUser")
// @GetMapping(value = "/yxWechatUser")
// @PreAuthorize("hasAnyRole('ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_SELECT')")
// public ResponseEntity getYxWechatUsers(YxWechatUserQueryCriteria criteria, Pageable pageable){
// return new ResponseEntity(yxWechatUserService.queryAll(criteria,pageable),HttpStatus.OK);
// }
//
// @Log("新增YxWechatUser")
// @ApiOperation(value = "新增YxWechatUser")
// @PostMapping(value = "/yxWechatUser")
// @PreAuthorize("hasAnyRole('ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_CREATE')")
// public ResponseEntity create(@Validated @RequestBody YxWechatUser resources){
// return new ResponseEntity(yxWechatUserService.create(resources),HttpStatus.CREATED);
// }
//
// @Log("修改YxWechatUser")
// @ApiOperation(value = "修改YxWechatUser")
// @PutMapping(value = "/yxWechatUser")
// @PreAuthorize("hasAnyRole('ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_EDIT')")
// public ResponseEntity update(@Validated @RequestBody YxWechatUser resources){
// yxWechatUserService.update(resources);
// return new ResponseEntity(HttpStatus.NO_CONTENT);
// }
//
// @Log("删除YxWechatUser")
// @ApiOperation(value = "删除YxWechatUser")
// @DeleteMapping(value = "/yxWechatUser/{uid}")
// @PreAuthorize("hasAnyRole('ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_DELETE')")
// public ResponseEntity delete(@PathVariable Integer uid){
// yxWechatUserService.delete(uid);
// return new ResponseEntity(HttpStatus.OK);
// }
//}

View File

@ -0,0 +1,46 @@
package co.yixiang.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @ClassName SwaggerConfiguration
* @Author hupeng <610796224@qq.com>
* @Date 2019/6/28
**/
@Configuration
@EnableSwagger2
public class SwaggerConfiguration {
@Value("${swagger.enabled}")
private Boolean enabled;
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.enable(enabled)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("co.yixiang.modules"))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("yshop商城管理后台API")
.description("yshop商城管理后台API")
.termsOfServiceUrl("http://localhost:8000")
.contact("610796224@qq.com")
.version("1.6")
.build();
}
}

View File

@ -1,6 +1,7 @@
package co.yixiang.modules.monitor.rest;
import co.yixiang.annotation.Limit;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -11,6 +12,7 @@ import java.util.concurrent.atomic.AtomicInteger;
*
* 接口限流测试类
*/
@Api(tags = "接口限流测试类")
@RestController
@RequestMapping("api")
public class LimitController {

View File

@ -6,6 +6,7 @@ import co.yixiang.exception.BadRequestException;
import co.yixiang.modules.monitor.service.RedisService;
import co.yixiang.aop.log.Log;
import co.yixiang.modules.monitor.domain.vo.RedisVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
* @author Zheng Jie
* @date 2018-12-10
*/
@Api(tags = "redis缓存管理")
@RestController
@RequestMapping("api")
public class RedisController {

View File

@ -2,6 +2,7 @@ package co.yixiang.modules.monitor.rest;
import co.yixiang.utils.RequestHolder;
import co.yixiang.modules.monitor.service.VisitsService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
* @author Zheng Jie
* @date 2018-12-13
*/
@Api(tags = "访问统计")
@RestController
@RequestMapping("api")
public class VisitsController {

View File

@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
import co.yixiang.exception.BadRequestException;
import co.yixiang.modules.quartz.domain.QuartzJob;
import co.yixiang.modules.quartz.service.QuartzJobService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import co.yixiang.aop.log.Log;
import co.yixiang.modules.quartz.service.dto.JobQueryCriteria;
@ -23,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
@Slf4j
@RestController
@RequestMapping("/api")
@Api(tags = "定时任务")
public class QuartzJobController {
private static final String ENTITY_NAME = "quartzJob";

View File

@ -12,6 +12,7 @@ import co.yixiang.modules.security.utils.VerifyCodeUtils;
import co.yixiang.utils.EncryptUtils;
import co.yixiang.utils.SecurityUtils;
import co.yixiang.utils.StringUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import co.yixiang.aop.log.Log;
import co.yixiang.modules.security.security.ImgResult;
@ -35,6 +36,7 @@ import java.io.IOException;
@Slf4j
@RestController
@RequestMapping("auth")
@Api(tags = "认证模块")
public class AuthenticationController {
@Value("${jwt.header}")

View File

@ -8,6 +8,7 @@ import co.yixiang.modules.system.domain.Dept;
import co.yixiang.modules.system.service.DeptService;
import co.yixiang.modules.system.service.dto.DeptDTO;
import co.yixiang.modules.system.service.dto.DeptQueryCriteria;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -22,6 +23,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("api")
@Api(tags = "部门管理")
public class DeptController {
@Autowired

View File

@ -6,6 +6,7 @@ import co.yixiang.aop.log.Log;
import co.yixiang.modules.system.domain.Dict;
import co.yixiang.modules.system.service.DictService;
import co.yixiang.modules.system.service.dto.DictQueryCriteria;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
*/
@RestController
@RequestMapping("api")
@Api(tags = "字典管理")
public class DictController {
@Autowired

View File

@ -6,6 +6,7 @@ import co.yixiang.aop.log.Log;
import co.yixiang.modules.system.domain.DictDetail;
import co.yixiang.modules.system.service.DictDetailService;
import co.yixiang.modules.system.service.dto.DictDetailQueryCriteria;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
@ -25,6 +26,7 @@ import java.util.Map;
*/
@RestController
@RequestMapping("api")
@Api(tags = "字典明细管理")
public class DictDetailController {
@Autowired

View File

@ -7,6 +7,7 @@ import co.yixiang.aop.log.Log;
import co.yixiang.modules.system.domain.Job;
import co.yixiang.modules.system.service.JobService;
import co.yixiang.modules.system.service.dto.JobQueryCriteria;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
*/
@RestController
@RequestMapping("api")
@Api(tags = "任务管理")
public class JobController {
@Autowired

View File

@ -12,6 +12,7 @@ import co.yixiang.modules.system.service.UserService;
import co.yixiang.modules.system.service.dto.MenuDTO;
import co.yixiang.modules.system.service.dto.MenuQueryCriteria;
import co.yixiang.modules.system.service.dto.UserDTO;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -28,6 +29,7 @@ import java.util.Set;
*/
@RestController
@RequestMapping("api")
@Api(tags = "菜单管理")
public class MenuController {
@Autowired

View File

@ -9,6 +9,7 @@ import co.yixiang.modules.system.service.PermissionService;
import co.yixiang.modules.system.service.dto.PermissionDTO;
import co.yixiang.modules.system.service.dto.PermissionQueryCriteria;
import co.yixiang.modules.system.service.mapper.PermissionMapper;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -26,6 +27,7 @@ import java.util.Set;
*/
@RestController
@RequestMapping("api")
@Api(tags = "权限管理")
public class PermissionController {
@Autowired

View File

@ -11,6 +11,7 @@ import co.yixiang.modules.system.domain.Role;
import co.yixiang.modules.system.service.RoleService;
import co.yixiang.modules.system.service.dto.RoleQueryCriteria;
import co.yixiang.modules.system.service.dto.RoleSmallDTO;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
@ -30,6 +31,7 @@ import java.util.stream.Collectors;
*/
@RestController
@RequestMapping("api")
@Api(tags = "角色管理")
public class RoleController {
@Autowired

View File

@ -20,6 +20,7 @@ import co.yixiang.modules.system.service.dto.RoleSmallDTO;
import co.yixiang.modules.system.service.dto.UserQueryCriteria;
import co.yixiang.utils.*;
import co.yixiang.modules.system.service.UserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
@ -42,6 +43,7 @@ import java.util.stream.Collectors;
*/
@RestController
@RequestMapping("api")
@Api(tags = "系统用户管理")
public class UserController {
@Autowired

View File

@ -1,5 +1,6 @@
package co.yixiang.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import co.yixiang.aop.log.Log;
@ -25,6 +26,7 @@ import java.util.Map;
@Slf4j
@RestController
@RequestMapping("/api")
@Api(tags = "支付宝支付")
public class AliPayController {
@Autowired

View File

@ -1,5 +1,6 @@
package co.yixiang.rest;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import co.yixiang.aop.log.Log;
import co.yixiang.domain.EmailConfig;
@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
@Slf4j
@RestController
@RequestMapping("api")
@Api(tags = "邮件")
public class EmailController {
@Autowired

View File

@ -5,6 +5,7 @@ import co.yixiang.domain.Picture;
import co.yixiang.service.PictureService;
import co.yixiang.service.dto.PictureQueryCriteria;
import co.yixiang.utils.SecurityUtils;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
@ -21,6 +22,7 @@ import java.util.Map;
*/
@RestController
@RequestMapping("/api")
@Api(tags = "图床")
public class PictureController {
@Autowired

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.exception.BadRequestException;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import co.yixiang.aop.log.Log;
import co.yixiang.domain.QiniuConfig;
@ -28,6 +29,7 @@ import java.util.Map;
@Slf4j
@RestController
@RequestMapping("api")
@Api(tags = "七牛")
public class QiniuController {
@Autowired

View File

@ -5,6 +5,7 @@ import co.yixiang.domain.vo.EmailVo;
import co.yixiang.service.EmailService;
import co.yixiang.service.VerificationCodeService;
import co.yixiang.utils.ElAdminConstant;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
*/
@RestController
@RequestMapping("api")
@Api(tags = "验证")
public class VerificationCodeController {
@Autowired