Compare commits
2 Commits
3d7623f673
...
3779fe9701
| Author | SHA1 | Date |
|---|---|---|
|
|
3779fe9701 | |
|
|
e1fbb33f48 |
195
api/app.json
195
api/app.json
|
|
@ -92,6 +92,34 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/logout": {
|
||||
"post": {
|
||||
"description": "登出",
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "登出",
|
||||
"operationId": "Logout",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/IDReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "BaseDataInfo",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/BaseDataInfo"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/register": {
|
||||
"post": {
|
||||
"description": "Register | 注册",
|
||||
|
|
@ -148,6 +176,52 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/user/checkLogin": {
|
||||
"post": {
|
||||
"description": "CheckLogin | 检测登录状态",
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "CheckLogin | 检测登录状态",
|
||||
"operationId": "CheckLogin",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/IDReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "BaseDataInfo",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/BaseDataInfo"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/info": {
|
||||
"post": {
|
||||
"description": "@ Get UserInfo detail By Token | 获取用户信息",
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "@ Get UserInfo detail By Token | 获取用户信息",
|
||||
"operationId": "GetUserInfoByToken",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "UserInfo",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/UserInfo"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/list": {
|
||||
"post": {
|
||||
"description": "List userInfo | 获取用户列表",
|
||||
|
|
@ -175,6 +249,90 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/oauthAuthorize": {
|
||||
"post": {
|
||||
"description": "OauthAuthorize | 第三方登录接口",
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "OauthAuthorize | 第三方登录接口",
|
||||
"operationId": "OauthAuthorize",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/OauthAuthorizeReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OauthAuthorizeResp",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/OauthAuthorizeResp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/passWordReset": {
|
||||
"post": {
|
||||
"description": "PassWordReset | 修改密码",
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "PassWordReset | 修改密码",
|
||||
"operationId": "PassWordReset",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/PassWordResetReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "BaseDataInfo",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/BaseDataInfo"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/update": {
|
||||
"post": {
|
||||
"description": "Update userInfo | 更新用户信息",
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "Update userInfo | 更新用户信息",
|
||||
"operationId": "UpdateUserInfo",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/UserInfo"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "BaseDataInfo",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/BaseDataInfo"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
|
|
@ -719,6 +877,27 @@
|
|||
},
|
||||
"x-go-package": "mingyang-admin-app-api/internal/types"
|
||||
},
|
||||
"OauthAuthorizeReq": {
|
||||
"type": "object",
|
||||
"x-go-package": "mingyang-admin-app-api/internal/types"
|
||||
},
|
||||
"OauthAuthorizeResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"description": "Error code | 错误代码",
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"x-go-name": "Code"
|
||||
},
|
||||
"msg": {
|
||||
"description": "Message | 提示信息",
|
||||
"type": "string",
|
||||
"x-go-name": "Msg"
|
||||
}
|
||||
},
|
||||
"x-go-package": "mingyang-admin-app-api/internal/types"
|
||||
},
|
||||
"PageInfo": {
|
||||
"description": "The page request parameters | 列表请求参数",
|
||||
"type": "object",
|
||||
|
|
@ -744,6 +923,22 @@
|
|||
},
|
||||
"x-go-package": "mingyang-admin-app-api/internal/types"
|
||||
},
|
||||
"PassWordResetReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"description": "Password",
|
||||
"type": "string",
|
||||
"x-go-name": "Password"
|
||||
},
|
||||
"userName": {
|
||||
"description": "UserName or Email or Mobile",
|
||||
"type": "string",
|
||||
"x-go-name": "UserName"
|
||||
}
|
||||
},
|
||||
"x-go-package": "mingyang-admin-app-api/internal/types"
|
||||
},
|
||||
"RegisterReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
|||
|
|
@ -139,6 +139,19 @@ type (
|
|||
// The device list data | User信息列表数据
|
||||
Data []UserInfo `json:"data"`
|
||||
}
|
||||
OauthAuthorizeReq {
|
||||
|
||||
}
|
||||
OauthAuthorizeResp {
|
||||
BaseMsgResp
|
||||
}
|
||||
PassWordResetReq {
|
||||
// UserName or Email or Mobile
|
||||
UserName string `json:"userName,optional"`
|
||||
// Password
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
)
|
||||
|
||||
@server (
|
||||
|
|
@ -167,9 +180,35 @@ service App {
|
|||
// Get userInfo detail by ID | 获取用户信息
|
||||
@handler getUserInfoById
|
||||
post /user (IDReq) returns (UserInfo)
|
||||
|
||||
//@ Get UserInfo detail By Token | 获取用户信息
|
||||
@handler getUserInfoByToken
|
||||
post /user/info () returns (UserInfo)
|
||||
|
||||
//List userInfo | 获取用户列表
|
||||
@handler listUserInfo
|
||||
post /user/list (UserListReq) returns (UserListResp)
|
||||
|
||||
//Update userInfo | 更新用户信息
|
||||
@handler updateUserInfo
|
||||
post /user/update (UserInfo) returns (BaseDataInfo)
|
||||
|
||||
// Logout | 退出登录
|
||||
@handler logout
|
||||
post /user/logout (IDReq) returns (BaseDataInfo)
|
||||
|
||||
// PassWordReset | 修改密码
|
||||
@handler passWordReset
|
||||
post /user/passWordReset (PassWordResetReq) returns (BaseDataInfo)
|
||||
|
||||
// CheckLogin | 检测登录状态
|
||||
@handler checkLogin
|
||||
post /user/checkLogin (IDReq) returns (BaseDataInfo)
|
||||
|
||||
//OauthAuthorize | 第三方登录接口
|
||||
@handler oauthAuthorize
|
||||
post /user/oauthAuthorize (OauthAuthorizeReq) returns (OauthAuthorizeResp)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,11 +54,41 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||
Path: "/user",
|
||||
Handler: user.GetUserInfoByIdHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/info",
|
||||
Handler: user.GetUserInfoByTokenHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/list",
|
||||
Handler: user.ListUserInfoHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/update",
|
||||
Handler: user.UpdateUserInfoHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/logout",
|
||||
Handler: user.LogoutHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/passWordReset",
|
||||
Handler: user.PassWordResetHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/checkLogin",
|
||||
Handler: user.CheckLoginHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/oauthAuthorize",
|
||||
Handler: user.OauthAuthorizeHandler(serverCtx),
|
||||
},
|
||||
}...,
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
|
||||
"mingyang-admin-app-api/internal/logic/user"
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
"mingyang-admin-app-api/internal/types"
|
||||
)
|
||||
|
||||
// swagger:route post /user/checkLogin user CheckLogin
|
||||
//
|
||||
// CheckLogin | 检测登录状态
|
||||
//
|
||||
// CheckLogin | 检测登录状态
|
||||
//
|
||||
// Parameters:
|
||||
// + name: body
|
||||
// require: true
|
||||
// in: body
|
||||
// type: IDReq
|
||||
//
|
||||
// Responses:
|
||||
// 200: BaseDataInfo
|
||||
|
||||
func CheckLoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.IDReq
|
||||
if err := httpx.Parse(r, &req, true); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := user.NewCheckLoginLogic(r.Context(), svcCtx)
|
||||
resp, err := l.CheckLogin(&req)
|
||||
if err != nil {
|
||||
err = svcCtx.Trans.TransError(r.Context(), err)
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
|
||||
"mingyang-admin-app-api/internal/logic/user"
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
)
|
||||
|
||||
// swagger:route post /user/info user GetUserInfoByToken
|
||||
//
|
||||
//@ Get UserInfo detail By Token | 获取用户信息
|
||||
//
|
||||
//@ Get UserInfo detail By Token | 获取用户信息
|
||||
//
|
||||
// Responses:
|
||||
// 200: UserInfo
|
||||
|
||||
func GetUserInfoByTokenHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := user.NewGetUserInfoByTokenLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetUserInfoByToken()
|
||||
if err != nil {
|
||||
err = svcCtx.Trans.TransError(r.Context(), err)
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
|
||||
"mingyang-admin-app-api/internal/logic/user"
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
"mingyang-admin-app-api/internal/types"
|
||||
)
|
||||
|
||||
// swagger:route post /logout user Logout
|
||||
//
|
||||
//登出
|
||||
//
|
||||
//登出
|
||||
//
|
||||
// Parameters:
|
||||
// + name: body
|
||||
// require: true
|
||||
// in: body
|
||||
// type: IDReq
|
||||
//
|
||||
// Responses:
|
||||
// 200: BaseDataInfo
|
||||
|
||||
func LogoutHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.IDReq
|
||||
if err := httpx.Parse(r, &req, true); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := user.NewLogoutLogic(r.Context(), svcCtx)
|
||||
resp, err := l.Logout(&req)
|
||||
if err != nil {
|
||||
err = svcCtx.Trans.TransError(r.Context(), err)
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
|
||||
"mingyang-admin-app-api/internal/logic/user"
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
"mingyang-admin-app-api/internal/types"
|
||||
)
|
||||
|
||||
// swagger:route post /user/oauthAuthorize user OauthAuthorize
|
||||
//
|
||||
//OauthAuthorize | 第三方登录接口
|
||||
//
|
||||
//OauthAuthorize | 第三方登录接口
|
||||
//
|
||||
// Parameters:
|
||||
// + name: body
|
||||
// require: true
|
||||
// in: body
|
||||
// type: OauthAuthorizeReq
|
||||
//
|
||||
// Responses:
|
||||
// 200: OauthAuthorizeResp
|
||||
|
||||
func OauthAuthorizeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.OauthAuthorizeReq
|
||||
if err := httpx.Parse(r, &req, true); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := user.NewOauthAuthorizeLogic(r.Context(), svcCtx)
|
||||
resp, err := l.OauthAuthorize(&req)
|
||||
if err != nil {
|
||||
err = svcCtx.Trans.TransError(r.Context(), err)
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
|
||||
"mingyang-admin-app-api/internal/logic/user"
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
"mingyang-admin-app-api/internal/types"
|
||||
)
|
||||
|
||||
// swagger:route post /user/passWordReset user PassWordReset
|
||||
//
|
||||
// PassWordReset | 修改密码
|
||||
//
|
||||
// PassWordReset | 修改密码
|
||||
//
|
||||
// Parameters:
|
||||
// + name: body
|
||||
// require: true
|
||||
// in: body
|
||||
// type: PassWordResetReq
|
||||
//
|
||||
// Responses:
|
||||
// 200: BaseDataInfo
|
||||
|
||||
func PassWordResetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.PassWordResetReq
|
||||
if err := httpx.Parse(r, &req, true); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := user.NewPassWordResetLogic(r.Context(), svcCtx)
|
||||
resp, err := l.PassWordReset(&req)
|
||||
if err != nil {
|
||||
err = svcCtx.Trans.TransError(r.Context(), err)
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
|
||||
"mingyang-admin-app-api/internal/logic/user"
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
"mingyang-admin-app-api/internal/types"
|
||||
)
|
||||
|
||||
// swagger:route post /user/update user UpdateUserInfo
|
||||
//
|
||||
//Update userInfo | 更新用户信息
|
||||
//
|
||||
//Update userInfo | 更新用户信息
|
||||
//
|
||||
// Parameters:
|
||||
// + name: body
|
||||
// require: true
|
||||
// in: body
|
||||
// type: UserInfo
|
||||
//
|
||||
// Responses:
|
||||
// 200: BaseDataInfo
|
||||
|
||||
func UpdateUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UserInfo
|
||||
if err := httpx.Parse(r, &req, true); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := user.NewUpdateUserInfoLogic(r.Context(), svcCtx)
|
||||
resp, err := l.UpdateUserInfo(&req)
|
||||
if err != nil {
|
||||
err = svcCtx.Trans.TransError(r.Context(), err)
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
"mingyang-admin-app-api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CheckLoginLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewCheckLoginLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CheckLoginLogic {
|
||||
return &CheckLoginLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CheckLoginLogic) CheckLogin(req *types.IDReq) (resp *types.BaseDataInfo, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
"mingyang-admin-app-api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetUserInfoByTokenLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetUserInfoByTokenLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserInfoByTokenLogic {
|
||||
return &GetUserInfoByTokenLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetUserInfoByTokenLogic) GetUserInfoByToken() (resp *types.UserInfo, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
"mingyang-admin-app-api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type LogoutLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewLogoutLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LogoutLogic {
|
||||
return &LogoutLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *LogoutLogic) Logout(req *types.IDReq) (resp *types.BaseDataInfo, err error) {
|
||||
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
"mingyang-admin-app-api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type OauthAuthorizeLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewOauthAuthorizeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OauthAuthorizeLogic {
|
||||
return &OauthAuthorizeLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *OauthAuthorizeLogic) OauthAuthorize(req *types.OauthAuthorizeReq) (resp *types.OauthAuthorizeResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
"mingyang-admin-app-api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type PassWordResetLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewPassWordResetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PassWordResetLogic {
|
||||
return &PassWordResetLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *PassWordResetLogic) PassWordReset(req *types.PassWordResetReq) (resp *types.BaseDataInfo, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"mingyang-admin-app-api/internal/svc"
|
||||
"mingyang-admin-app-api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UpdateUserInfoLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewUpdateUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateUserInfoLogic {
|
||||
return &UpdateUserInfoLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateUserInfoLogic) UpdateUserInfo(req *types.UserInfo) (resp *types.BaseDataInfo, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
|
|
@ -39,8 +39,7 @@ func (l *LoginLogic) Login(req *types.LoginReq) (resp *types.LoginResp, err erro
|
|||
user := loginUser.User
|
||||
return &types.LoginResp{
|
||||
BaseMsgResp: types.BaseMsgResp{
|
||||
Code: 0,
|
||||
Msg: "登录成功",
|
||||
Code: 200,
|
||||
},
|
||||
AuthToken: &types.AuthToken{
|
||||
AccessToken: token.AccessToken,
|
||||
|
|
|
|||
|
|
@ -397,3 +397,20 @@ type UserListInfo struct {
|
|||
// The device list data | User信息列表数据
|
||||
Data []UserInfo `json:"data"`
|
||||
}
|
||||
|
||||
// swagger:model OauthAuthorizeReq
|
||||
type OauthAuthorizeReq struct {
|
||||
}
|
||||
|
||||
// swagger:model OauthAuthorizeResp
|
||||
type OauthAuthorizeResp struct {
|
||||
BaseMsgResp
|
||||
}
|
||||
|
||||
// swagger:model PassWordResetReq
|
||||
type PassWordResetReq struct {
|
||||
// UserName or Email or Mobile
|
||||
UserName string `json:"userName,optional"`
|
||||
// Password
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue