1.后台登录接口
2.异常处理
This commit is contained in:
@@ -5,14 +5,12 @@ import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.account.service.AuthorizationService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 商户登录相关
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@@ -24,13 +22,22 @@ public class AuthorizationController {
|
||||
this.authorizationService = authorizationService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证码获取
|
||||
* @return 验证码信息
|
||||
*/
|
||||
@GetMapping("captcha")
|
||||
public CzgResult<?> captcha() {
|
||||
return CzgResult.success(authorizationService.getCaptcha());
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户登录
|
||||
* @param loginDTO 登录参数
|
||||
* @return token信息
|
||||
*/
|
||||
@PostMapping("login")
|
||||
public CzgResult<?> login(@Validated SysLoginDTO loginDTO) {
|
||||
public CzgResult<?> login(@Validated @RequestBody SysLoginDTO loginDTO) {
|
||||
return CzgResult.success(authorizationService.login(loginDTO));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.czg.controller;
|
||||
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.service.account.service.SysMenuService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 菜单管理
|
||||
* @author zs
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/menus")
|
||||
public class MenuController {
|
||||
|
||||
@Resource
|
||||
private SysMenuService menuService;
|
||||
|
||||
/**
|
||||
* 获取当前用户菜单列表
|
||||
* @return 菜单结构
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<?> get() {
|
||||
return CzgResult.success(menuService.getMenu());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.czg.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.service.account.service.ShopInfoService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -19,6 +21,7 @@ public class ShopInfoController {
|
||||
this.shopInfoService = shopInfoService;
|
||||
}
|
||||
|
||||
@SaAdminCheckPermission("shopInfo:add")
|
||||
@PostMapping
|
||||
public CzgResult add() {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user