Commit cdf7fa40 by leejoker

📝 增加swagger

1 parent a677e345
...@@ -9,8 +9,9 @@ import com.linkwechat.common.enums.BusinessType; ...@@ -9,8 +9,9 @@ import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.wecom.domain.WeSensitive; import com.linkwechat.wecom.domain.WeSensitive;
import com.linkwechat.wecom.domain.query.WeSensitiveHitQuery; import com.linkwechat.wecom.domain.query.WeSensitiveHitQuery;
import com.linkwechat.wecom.service.IWeSensitiveService; import com.linkwechat.wecom.service.IWeSensitiveService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
...@@ -26,6 +27,7 @@ import java.util.stream.Collectors; ...@@ -26,6 +27,7 @@ import java.util.stream.Collectors;
*/ */
@RestController @RestController
@RequestMapping("/wecom/sensitive") @RequestMapping("/wecom/sensitive")
@Api(tags = "敏感词管理")
public class WeSensitiveController extends BaseController { public class WeSensitiveController extends BaseController {
@Autowired @Autowired
private IWeSensitiveService weSensitiveService; private IWeSensitiveService weSensitiveService;
...@@ -35,6 +37,7 @@ public class WeSensitiveController extends BaseController { ...@@ -35,6 +37,7 @@ public class WeSensitiveController extends BaseController {
*/ */
// @PreAuthorize("@ss.hasPermi('wecom:sensitive:list')") // @PreAuthorize("@ss.hasPermi('wecom:sensitive:list')")
@GetMapping("/list") @GetMapping("/list")
@ApiOperation("查询敏感词列表")
public TableDataInfo list(WeSensitive weSensitive) { public TableDataInfo list(WeSensitive weSensitive) {
startPage(); startPage();
List<WeSensitive> list = weSensitiveService.selectWeSensitiveList(weSensitive); List<WeSensitive> list = weSensitiveService.selectWeSensitiveList(weSensitive);
...@@ -46,6 +49,7 @@ public class WeSensitiveController extends BaseController { ...@@ -46,6 +49,7 @@ public class WeSensitiveController extends BaseController {
*/ */
// @PreAuthorize("@ss.hasPermi('wecom:sensitive:query')") // @PreAuthorize("@ss.hasPermi('wecom:sensitive:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
@ApiOperation("查询敏感词详情")
public AjaxResult getInfo(@PathVariable("id") Long id) { public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(weSensitiveService.selectWeSensitiveById(id)); return AjaxResult.success(weSensitiveService.selectWeSensitiveById(id));
} }
...@@ -56,6 +60,7 @@ public class WeSensitiveController extends BaseController { ...@@ -56,6 +60,7 @@ public class WeSensitiveController extends BaseController {
// @PreAuthorize("@ss.hasPermi('wecom:sensitive:add')") // @PreAuthorize("@ss.hasPermi('wecom:sensitive:add')")
@Log(title = "敏感词设置", businessType = BusinessType.INSERT) @Log(title = "敏感词设置", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
@ApiOperation("添加敏感词")
public AjaxResult add(@Valid @RequestBody WeSensitive weSensitive) { public AjaxResult add(@Valid @RequestBody WeSensitive weSensitive) {
return toAjax(weSensitiveService.insertWeSensitive(weSensitive)); return toAjax(weSensitiveService.insertWeSensitive(weSensitive));
} }
...@@ -66,6 +71,7 @@ public class WeSensitiveController extends BaseController { ...@@ -66,6 +71,7 @@ public class WeSensitiveController extends BaseController {
// @PreAuthorize("@ss.hasPermi('wecom:sensitive:edit')") // @PreAuthorize("@ss.hasPermi('wecom:sensitive:edit')")
@Log(title = "敏感词设置", businessType = BusinessType.UPDATE) @Log(title = "敏感词设置", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
@ApiOperation("修改敏感词")
public AjaxResult edit(@Valid @RequestBody WeSensitive weSensitive) { public AjaxResult edit(@Valid @RequestBody WeSensitive weSensitive) {
Long id = weSensitive.getId(); Long id = weSensitive.getId();
WeSensitive originData = weSensitiveService.selectWeSensitiveById(id); WeSensitive originData = weSensitiveService.selectWeSensitiveById(id);
...@@ -81,6 +87,7 @@ public class WeSensitiveController extends BaseController { ...@@ -81,6 +87,7 @@ public class WeSensitiveController extends BaseController {
// @PreAuthorize("@ss.hasPermi('wecom:sensitive:remove')") // @PreAuthorize("@ss.hasPermi('wecom:sensitive:remove')")
@Log(title = "敏感词设置", businessType = BusinessType.DELETE) @Log(title = "敏感词设置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
@ApiOperation("删除敏感词")
public AjaxResult remove(@PathVariable("ids") String ids) { public AjaxResult remove(@PathVariable("ids") String ids) {
String[] id = ids.split(","); String[] id = ids.split(",");
Long[] idArray = new Long[id.length]; Long[] idArray = new Long[id.length];
...@@ -93,6 +100,7 @@ public class WeSensitiveController extends BaseController { ...@@ -93,6 +100,7 @@ public class WeSensitiveController extends BaseController {
*/ */
// @PreAuthorize("@ss.hasPermi('wecom:sensitivehit:list')") // @PreAuthorize("@ss.hasPermi('wecom:sensitivehit:list')")
@GetMapping("/hit/list") @GetMapping("/hit/list")
@ApiOperation("敏感词命中查询")
public TableDataInfo hitList(WeSensitiveHitQuery query) { public TableDataInfo hitList(WeSensitiveHitQuery query) {
return getDataTable(weSensitiveService.getHitSensitiveList(query)); return getDataTable(weSensitiveService.getHitSensitiveList(query));
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!