fix_api
This commit is contained in:
@@ -11,22 +11,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type IUserV1 interface {
|
type IUserV1 interface {
|
||||||
FansList(ctx context.Context, req *v1.FansListReq) (res *v1.FansListRes, err error)
|
|
||||||
FansView(ctx context.Context, req *v1.FansViewReq) (res *v1.FansViewRes, err error)
|
|
||||||
FansUpdate(ctx context.Context, req *v1.FansUpdateReq) (res *v1.FansUpdateRes, err error)
|
|
||||||
FansDelete(ctx context.Context, req *v1.FansDeleteReq) (res *v1.FansDeleteRes, err error)
|
|
||||||
FansCreate(ctx context.Context, req *v1.FansCreateReq) (res *v1.FansCreateRes, err error)
|
|
||||||
RoleCreate(ctx context.Context, req *v1.RoleCreateReq) (res *v1.RoleCreateRes, err error)
|
RoleCreate(ctx context.Context, req *v1.RoleCreateReq) (res *v1.RoleCreateRes, err error)
|
||||||
RoleUpdate(ctx context.Context, req *v1.RoleUpdateReq) (res *v1.RoleUpdateRes, err error)
|
RoleUpdate(ctx context.Context, req *v1.RoleUpdateReq) (res *v1.RoleUpdateRes, err error)
|
||||||
RoleView(ctx context.Context, req *v1.RoleViewReq) (res *v1.RoleViewRes, err error)
|
RoleView(ctx context.Context, req *v1.RoleViewReq) (res *v1.RoleViewRes, err error)
|
||||||
RoleList(ctx context.Context, req *v1.RoleListReq) (res *v1.RoleListRes, err error)
|
RoleList(ctx context.Context, req *v1.RoleListReq) (res *v1.RoleListRes, err error)
|
||||||
RoleDelete(ctx context.Context, req *v1.RoleDeleteReq) (res *v1.RoleDeleteRes, err error)
|
RoleDelete(ctx context.Context, req *v1.RoleDeleteReq) (res *v1.RoleDeleteRes, err error)
|
||||||
RolePermissionCheck(ctx context.Context, req *v1.RolePermissionCheckReq) (res *v1.RolePermissionCheckRes, err error)
|
RolePermissionCheck(ctx context.Context, req *v1.RolePermissionCheckReq) (res *v1.RolePermissionCheckRes, err error)
|
||||||
SubscribeList(ctx context.Context, req *v1.SubscribeListReq) (res *v1.SubscribeListRes, err error)
|
|
||||||
SubscribeView(ctx context.Context, req *v1.SubscribeViewReq) (res *v1.SubscribeViewRes, err error)
|
|
||||||
SubscribeUpdate(ctx context.Context, req *v1.SubscribeUpdateReq) (res *v1.SubscribeUpdateRes, err error)
|
|
||||||
SubscribeDelete(ctx context.Context, req *v1.SubscribeDeleteReq) (res *v1.SubscribeDeleteRes, err error)
|
|
||||||
SubscribeCreate(ctx context.Context, req *v1.SubscribeCreateReq) (res *v1.SubscribeCreateRes, err error)
|
|
||||||
TraceList(ctx context.Context, req *v1.TraceListReq) (res *v1.TraceListRes, err error)
|
TraceList(ctx context.Context, req *v1.TraceListReq) (res *v1.TraceListRes, err error)
|
||||||
TraceView(ctx context.Context, req *v1.TraceViewReq) (res *v1.TraceViewRes, err error)
|
TraceView(ctx context.Context, req *v1.TraceViewReq) (res *v1.TraceViewRes, err error)
|
||||||
TraceUpdate(ctx context.Context, req *v1.TraceUpdateReq) (res *v1.TraceUpdateRes, err error)
|
TraceUpdate(ctx context.Context, req *v1.TraceUpdateReq) (res *v1.TraceUpdateRes, err error)
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
package v1
|
|
||||||
|
|
||||||
import (
|
|
||||||
"TrangleAgent/internal/model/response"
|
|
||||||
|
|
||||||
"github.com/gogf/gf/v2/frame/g"
|
|
||||||
"github.com/gogf/gf/v2/os/gtime"
|
|
||||||
)
|
|
||||||
|
|
||||||
// FansListItem 粉丝列表项
|
|
||||||
type FansListItem struct {
|
|
||||||
Id uint64 `json:"id" description:"自增主键"`
|
|
||||||
UserId uint64 `json:"userId" description:"用户ID(被关注者,本人)"`
|
|
||||||
FanId uint64 `json:"fanId" description:"粉丝用户ID"`
|
|
||||||
Status int `json:"status" description:"状态:1=粉丝 0=取关/无效"`
|
|
||||||
Remark string `json:"remark" description:"备注名(user_id 对 fan_id 的备注/分组)"`
|
|
||||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
|
||||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansListReq 粉丝列表请求参数
|
|
||||||
type FansListReq struct {
|
|
||||||
response.PageResult
|
|
||||||
g.Meta `path:"/fans/list" method:"get" tags:"粉丝" summary:"粉丝列表"`
|
|
||||||
UserId uint64 `json:"userId" v:"required#用户ID不能为空"`
|
|
||||||
Status int `json:"status" description:"状态:1=粉丝 0=取关/无效"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansListRes 粉丝列表响应参数
|
|
||||||
type FansListRes struct {
|
|
||||||
response.PageResult
|
|
||||||
List []*FansListItem `json:"list"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansViewReq 粉丝详情请求参数
|
|
||||||
type FansViewReq struct {
|
|
||||||
g.Meta `path:"/fans/view" method:"get" tags:"粉丝" summary:"粉丝详情"`
|
|
||||||
Id uint64 `json:"id" v:"required#粉丝关系ID不能为空"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansViewRes 粉丝详情响应参数
|
|
||||||
type FansViewRes struct {
|
|
||||||
FansListItem
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansUpdateReq 粉丝更新请求参数
|
|
||||||
type FansUpdateReq struct {
|
|
||||||
g.Meta `path:"/fans/update" method:"put" tags:"粉丝" summary:"更新粉丝"`
|
|
||||||
Id uint64 `json:"id" v:"required#粉丝关系ID不能为空"`
|
|
||||||
Status int `json:"status" description:"状态:1=粉丝 0=取关/无效"`
|
|
||||||
Remark string `json:"remark" description:"备注名(user_id 对 fan_id 的备注/分组)"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansUpdateRes 粉丝更新响应参数
|
|
||||||
type FansUpdateRes struct {
|
|
||||||
Id uint64 `json:"id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansDeleteReq 粉丝删除请求参数
|
|
||||||
type FansDeleteReq struct {
|
|
||||||
g.Meta `path:"/fans/delete" method:"delete" tags:"粉丝" summary:"删除粉丝"`
|
|
||||||
Id uint64 `json:"id" v:"required#粉丝关系ID不能为空"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansDeleteRes 粉丝删除响应参数
|
|
||||||
type FansDeleteRes struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansCreateReq 粉丝创建请求参数
|
|
||||||
type FansCreateReq struct {
|
|
||||||
g.Meta `path:"/fans/create" method:"post" tags:"粉丝" summary:"创建粉丝"`
|
|
||||||
UserId uint64 `json:"userId" v:"required#用户ID不能为空"`
|
|
||||||
FanId uint64 `json:"fanId" v:"required#粉丝用户ID不能为空"`
|
|
||||||
Remark string `json:"remark" description:"备注名(user_id 对 fan_id 的备注/分组)"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansCreateRes 粉丝创建响应参数
|
|
||||||
type FansCreateRes struct {
|
|
||||||
Id uint64 `json:"id"`
|
|
||||||
}
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
package v1
|
|
||||||
|
|
||||||
import (
|
|
||||||
"TrangleAgent/internal/model/response"
|
|
||||||
|
|
||||||
"github.com/gogf/gf/v2/frame/g"
|
|
||||||
"github.com/gogf/gf/v2/os/gtime"
|
|
||||||
)
|
|
||||||
|
|
||||||
// SubscribeListItem 关注列表项
|
|
||||||
type SubscribeListItem struct {
|
|
||||||
Id uint64 `json:"id" description:"自增主键"`
|
|
||||||
UserId uint64 `json:"userId" description:"用户ID(关注者,本人)"`
|
|
||||||
FollowId uint64 `json:"followId" description:"被关注的用户ID"`
|
|
||||||
Status int `json:"status" description:"状态:1=关注中 0=取消关注"`
|
|
||||||
Remark string `json:"remark" description:"备注名(user_id 对 follow_id 的备注)"`
|
|
||||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
|
||||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeListReq 关注列表请求参数
|
|
||||||
type SubscribeListReq struct {
|
|
||||||
response.PageResult
|
|
||||||
g.Meta `path:"/subscribe/list" method:"get" tags:"关注" summary:"关注列表"`
|
|
||||||
UserId uint64 `json:"userId" v:"required#用户ID不能为空"`
|
|
||||||
Status int `json:"status" description:"状态:1=关注中 0=取消关注"`
|
|
||||||
FollowId uint64 `json:"followId" description:"被关注的用户ID"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeListRes 关注列表响应参数
|
|
||||||
type SubscribeListRes struct {
|
|
||||||
response.PageResult
|
|
||||||
List []*SubscribeListItem `json:"list"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeViewReq 关注详情请求参数
|
|
||||||
type SubscribeViewReq struct {
|
|
||||||
g.Meta `path:"/subscribe/view" method:"get" tags:"关注" summary:"关注详情"`
|
|
||||||
Id uint64 `json:"id" v:"required#关注关系ID不能为空"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeViewRes 关注详情响应参数
|
|
||||||
type SubscribeViewRes struct {
|
|
||||||
SubscribeListItem
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeUpdateReq 关注更新请求参数
|
|
||||||
type SubscribeUpdateReq struct {
|
|
||||||
g.Meta `path:"/subscribe/update" method:"put" tags:"关注" summary:"更新关注"`
|
|
||||||
Id uint64 `json:"id" v:"required#关注关系ID不能为空"`
|
|
||||||
Status int `json:"status" description:"状态:1=关注中 0=取消关注"`
|
|
||||||
Remark string `json:"remark" description:"备注名(user_id 对 follow_id 的备注)"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeUpdateRes 关注更新响应参数
|
|
||||||
type SubscribeUpdateRes struct {
|
|
||||||
Id uint64 `json:"id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeDeleteReq 关注删除请求参数
|
|
||||||
type SubscribeDeleteReq struct {
|
|
||||||
g.Meta `path:"/subscribe/delete" method:"delete" tags:"关注" summary:"删除关注"`
|
|
||||||
Id uint64 `json:"id" v:"required#关注关系ID不能为空"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeDeleteRes 关注删除响应参数
|
|
||||||
type SubscribeDeleteRes struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeCreateReq 关注创建请求参数
|
|
||||||
type SubscribeCreateReq struct {
|
|
||||||
g.Meta `path:"/subscribe/create" method:"post" tags:"关注" summary:"创建关注"`
|
|
||||||
UserId uint64 `json:"userId" v:"required#用户ID不能为空"`
|
|
||||||
FollowId uint64 `json:"followId" v:"required#被关注用户ID不能为空"`
|
|
||||||
Remark string `json:"remark" description:"备注名(user_id 对 follow_id 的备注)"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeCreateRes 关注创建响应参数
|
|
||||||
type SubscribeCreateRes struct {
|
|
||||||
Id uint64 `json:"id"`
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package forum
|
package forum
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
v1 "TrangleAgent/api/forum/v1"
|
v1 "TrangleAgent/api/forum/v1"
|
||||||
"TrangleAgent/internal/service"
|
"TrangleAgent/internal/service"
|
||||||
|
"context"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ControllerV1 struct{}
|
type ControllerV1 struct{}
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ func (c *RoleControllerV1) RoleList(ctx context.Context, req *v1.RoleListReq) (r
|
|||||||
|
|
||||||
func (c *RoleControllerV1) RoleDelete(ctx context.Context, req *v1.RoleDeleteReq) (res *v1.RoleDeleteRes, err error) {
|
func (c *RoleControllerV1) RoleDelete(ctx context.Context, req *v1.RoleDeleteReq) (res *v1.RoleDeleteRes, err error) {
|
||||||
return service.User().RoleDelete(ctx, req)
|
return service.User().RoleDelete(ctx, req)
|
||||||
} // RolePermissionCheck 权限查询
|
}
|
||||||
|
// RolePermissionCheck 权限查询
|
||||||
func (c *RoleControllerV1) RolePermissionCheck(ctx context.Context, req *v1.RolePermissionCheckReq) (res *v1.RolePermissionCheckRes, err error) {
|
func (c *RoleControllerV1) RolePermissionCheck(ctx context.Context, req *v1.RolePermissionCheckReq) (res *v1.RolePermissionCheckRes, err error) {
|
||||||
return service.User().RolePermissionCheck(ctx, req)
|
return service.User().RolePermissionCheck(ctx, req)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,48 +26,6 @@ func (c *ControllerV1) UserDelete(ctx context.Context, req *v1.UserDeleteReq) (r
|
|||||||
return service.User().UserDelete(ctx, req)
|
return service.User().UserDelete(ctx, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fans 相关方法
|
|
||||||
func (c *ControllerV1) FansList(ctx context.Context, req *v1.FansListReq) (res *v1.FansListRes, err error) {
|
|
||||||
return service.Fans().FansList(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *ControllerV1) FansView(ctx context.Context, req *v1.FansViewReq) (res *v1.FansViewRes, err error) {
|
|
||||||
return service.Fans().FansView(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *ControllerV1) FansUpdate(ctx context.Context, req *v1.FansUpdateReq) (res *v1.FansUpdateRes, err error) {
|
|
||||||
return service.Fans().FansUpdate(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *ControllerV1) FansDelete(ctx context.Context, req *v1.FansDeleteReq) (res *v1.FansDeleteRes, err error) {
|
|
||||||
return service.Fans().FansDelete(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *ControllerV1) FansCreate(ctx context.Context, req *v1.FansCreateReq) (res *v1.FansCreateRes, err error) {
|
|
||||||
return service.Fans().FansCreate(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Subscribe 相关方法
|
|
||||||
func (c *ControllerV1) SubscribeList(ctx context.Context, req *v1.SubscribeListReq) (res *v1.SubscribeListRes, err error) {
|
|
||||||
return service.Subscribe().SubscribeList(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *ControllerV1) SubscribeView(ctx context.Context, req *v1.SubscribeViewReq) (res *v1.SubscribeViewRes, err error) {
|
|
||||||
return service.Subscribe().SubscribeView(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *ControllerV1) SubscribeUpdate(ctx context.Context, req *v1.SubscribeUpdateReq) (res *v1.SubscribeUpdateRes, err error) {
|
|
||||||
return service.Subscribe().SubscribeUpdate(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *ControllerV1) SubscribeDelete(ctx context.Context, req *v1.SubscribeDeleteReq) (res *v1.SubscribeDeleteRes, err error) {
|
|
||||||
return service.Subscribe().SubscribeDelete(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *ControllerV1) SubscribeCreate(ctx context.Context, req *v1.SubscribeCreateReq) (res *v1.SubscribeCreateRes, err error) {
|
|
||||||
return service.Subscribe().SubscribeCreate(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Trace 相关方法
|
// Trace 相关方法
|
||||||
func (c *ControllerV1) TraceList(ctx context.Context, req *v1.TraceListReq) (res *v1.TraceListRes, err error) {
|
func (c *ControllerV1) TraceList(ctx context.Context, req *v1.TraceListReq) (res *v1.TraceListRes, err error) {
|
||||||
return service.Trace().TraceList(ctx, req)
|
return service.Trace().TraceList(ctx, req)
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
package ForumComments
|
package ForumComments
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
v1 "TrangleAgent/api/forum/v1"
|
||||||
"errors"
|
|
||||||
"github.com/gogf/gf/v2/errors/gerror"
|
|
||||||
"github.com/gogf/gf/v2/frame/g"
|
|
||||||
"TrangleAgent/api/forum/v1"
|
|
||||||
"TrangleAgent/internal/dao"
|
"TrangleAgent/internal/dao"
|
||||||
"TrangleAgent/internal/model/entity"
|
"TrangleAgent/internal/model/entity"
|
||||||
"TrangleAgent/internal/service"
|
"TrangleAgent/internal/service"
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/gogf/gf/v2/database/gdb"
|
||||||
|
"github.com/gogf/gf/v2/errors/gerror"
|
||||||
|
"github.com/gogf/gf/v2/frame/g"
|
||||||
|
"github.com/gogf/gf/v2/os/gtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ForumComments 评论相关方法
|
// ForumComments 评论相关方法
|
||||||
@@ -21,13 +25,12 @@ func init() {
|
|||||||
// ForumCommentsCreate 创建评论
|
// ForumCommentsCreate 创建评论
|
||||||
func (s *sForumComments) Create(ctx context.Context, req *v1.ForumCommentsCreateReq) (res *v1.ForumCommentsCreateRes, err error) {
|
func (s *sForumComments) Create(ctx context.Context, req *v1.ForumCommentsCreateReq) (res *v1.ForumCommentsCreateRes, err error) {
|
||||||
data := &entity.ForumComments{
|
data := &entity.ForumComments{
|
||||||
UserId: req.UserId,
|
UserId: req.UserId,
|
||||||
PostId: req.PostId,
|
PostId: req.PostId,
|
||||||
ParentId: req.ParentId,
|
ParentId: req.ParentId,
|
||||||
Content: req.Content,
|
Content: req.Content,
|
||||||
Status: req.Status,
|
Status: req.Status,
|
||||||
LikeCount: 0,
|
LikeCount: 0,
|
||||||
ReplyCount: 0,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := dao.ForumComments.Ctx(ctx).Data(data).OmitEmpty().Insert()
|
result, err := dao.ForumComments.Ctx(ctx).Data(data).OmitEmpty().Insert()
|
||||||
@@ -42,20 +45,15 @@ func (s *sForumComments) Create(ctx context.Context, req *v1.ForumCommentsCreate
|
|||||||
|
|
||||||
// 更新帖子的评论数
|
// 更新帖子的评论数
|
||||||
if req.PostId > 0 {
|
if req.PostId > 0 {
|
||||||
_, err = dao.ForumPosts.Ctx(ctx).WherePri(req.PostId).OnDuplicate("comment_count", 1).Update()
|
updateData := map[string]interface{}{
|
||||||
|
dao.ForumPosts.Columns().CommentCount: gdb.Raw(fmt.Sprintf("%s + 1", dao.ForumPosts.Columns().CommentCount)),
|
||||||
|
}
|
||||||
|
_, err = dao.ForumPosts.Ctx(ctx).WherePri(req.PostId).Data(updateData).Update()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
g.Log().Warning(ctx, "更新帖子评论数失败:", err)
|
g.Log().Warning(ctx, "更新帖子评论数失败:", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果是回复评论,则更新父评论的回复数
|
|
||||||
if req.ParentId > 0 {
|
|
||||||
_, err = dao.ForumComments.Ctx(ctx).WherePri(req.ParentId).OnDuplicate("reply_count", 1).Update()
|
|
||||||
if err != nil {
|
|
||||||
g.Log().Warning(ctx, "更新父评论回复数失败:", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return &v1.ForumCommentsCreateRes{
|
return &v1.ForumCommentsCreateRes{
|
||||||
Id: uint64(id),
|
Id: uint64(id),
|
||||||
}, nil
|
}, nil
|
||||||
@@ -63,8 +61,11 @@ func (s *sForumComments) Create(ctx context.Context, req *v1.ForumCommentsCreate
|
|||||||
|
|
||||||
// ForumCommentsUpdate 更新评论
|
// ForumCommentsUpdate 更新评论
|
||||||
func (s *sForumComments) Update(ctx context.Context, req *v1.ForumCommentsUpdateReq) (res *v1.ForumCommentsUpdateRes, err error) {
|
func (s *sForumComments) Update(ctx context.Context, req *v1.ForumCommentsUpdateReq) (res *v1.ForumCommentsUpdateRes, err error) {
|
||||||
// 检查评论是否存在
|
// 检查评论是否存在(排除已删除的)
|
||||||
one, err := dao.ForumComments.Ctx(ctx).WherePri(req.Id).One()
|
one, err := dao.ForumComments.Ctx(ctx).
|
||||||
|
WherePri(req.Id).
|
||||||
|
WhereNull(dao.ForumComments.Columns().DeletedAt).
|
||||||
|
One()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, gerror.Wrap(err, "查询评论失败")
|
return nil, gerror.Wrap(err, "查询评论失败")
|
||||||
}
|
}
|
||||||
@@ -85,7 +86,10 @@ func (s *sForumComments) Update(ctx context.Context, req *v1.ForumCommentsUpdate
|
|||||||
|
|
||||||
// ForumCommentsView 查看评论
|
// ForumCommentsView 查看评论
|
||||||
func (s *sForumComments) View(ctx context.Context, req *v1.ForumCommentsViewReq) (res *v1.ForumCommentsViewRes, err error) {
|
func (s *sForumComments) View(ctx context.Context, req *v1.ForumCommentsViewReq) (res *v1.ForumCommentsViewRes, err error) {
|
||||||
record, err := dao.ForumComments.Ctx(ctx).WherePri(req.Id).One()
|
record, err := dao.ForumComments.Ctx(ctx).
|
||||||
|
WherePri(req.Id).
|
||||||
|
WhereNull(dao.ForumComments.Columns().DeletedAt).
|
||||||
|
One()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, gerror.Wrap(err, "查询评论失败")
|
return nil, gerror.Wrap(err, "查询评论失败")
|
||||||
}
|
}
|
||||||
@@ -100,16 +104,15 @@ func (s *sForumComments) View(ctx context.Context, req *v1.ForumCommentsViewReq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
res = &v1.ForumCommentsViewRes{
|
res = &v1.ForumCommentsViewRes{
|
||||||
Id: entity.Id,
|
Id: entity.Id,
|
||||||
UserId: entity.UserId,
|
UserId: entity.UserId,
|
||||||
PostId: entity.PostId,
|
PostId: entity.PostId,
|
||||||
ParentId: entity.ParentId,
|
ParentId: entity.ParentId,
|
||||||
Content: entity.Content,
|
Content: entity.Content,
|
||||||
Status: entity.Status,
|
Status: entity.Status,
|
||||||
LikeCount: entity.LikeCount,
|
LikeCount: entity.LikeCount,
|
||||||
ReplyCount: entity.ReplyCount,
|
CreatedAt: entity.CreatedAt,
|
||||||
CreatedAt: entity.CreatedAt,
|
UpdatedAt: entity.UpdatedAt,
|
||||||
UpdatedAt: entity.UpdatedAt,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
@@ -117,23 +120,25 @@ func (s *sForumComments) View(ctx context.Context, req *v1.ForumCommentsViewReq)
|
|||||||
|
|
||||||
// ForumCommentsList 评论列表
|
// ForumCommentsList 评论列表
|
||||||
func (s *sForumComments) List(ctx context.Context, req *v1.ForumCommentsListReq) (res *v1.ForumCommentsListRes, err error) {
|
func (s *sForumComments) List(ctx context.Context, req *v1.ForumCommentsListReq) (res *v1.ForumCommentsListRes, err error) {
|
||||||
query := dao.ForumComments.Ctx(ctx).OmitEmpty()
|
query := dao.ForumComments.Ctx(ctx).
|
||||||
|
WhereNull(dao.ForumComments.Columns().DeletedAt).
|
||||||
|
OmitEmpty()
|
||||||
|
|
||||||
if req.UserId > 0 {
|
if req.UserId > 0 {
|
||||||
query = query.Where("user_id", req.UserId)
|
query = query.Where(dao.ForumComments.Columns().UserId, req.UserId)
|
||||||
}
|
}
|
||||||
if req.PostId > 0 {
|
if req.PostId > 0 {
|
||||||
query = query.Where("post_id", req.PostId)
|
query = query.Where(dao.ForumComments.Columns().PostId, req.PostId)
|
||||||
}
|
}
|
||||||
if req.ParentId > 0 {
|
if req.ParentId > 0 {
|
||||||
query = query.Where("parent_id", req.ParentId)
|
query = query.Where(dao.ForumComments.Columns().ParentId, req.ParentId)
|
||||||
}
|
}
|
||||||
if req.Status != "" {
|
if req.Status != "" {
|
||||||
query = query.Where("status", req.Status)
|
query = query.Where(dao.ForumComments.Columns().Status, req.Status)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分页查询
|
// 分页查询
|
||||||
pageResult, err := query.Page(req.Page, req.PageSize).Order("created_at DESC").All()
|
pageResult, err := query.Page(req.Page, req.PageSize).OrderDesc(dao.ForumComments.Columns().CreatedAt).All()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, gerror.Wrap(err, "查询评论列表失败")
|
return nil, gerror.Wrap(err, "查询评论列表失败")
|
||||||
}
|
}
|
||||||
@@ -147,16 +152,15 @@ func (s *sForumComments) List(ctx context.Context, req *v1.ForumCommentsListReq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
item := &v1.ForumCommentsViewRes{
|
item := &v1.ForumCommentsViewRes{
|
||||||
Id: entity.Id,
|
Id: entity.Id,
|
||||||
UserId: entity.UserId,
|
UserId: entity.UserId,
|
||||||
PostId: entity.PostId,
|
PostId: entity.PostId,
|
||||||
ParentId: entity.ParentId,
|
ParentId: entity.ParentId,
|
||||||
Content: entity.Content,
|
Content: entity.Content,
|
||||||
Status: entity.Status,
|
Status: entity.Status,
|
||||||
LikeCount: entity.LikeCount,
|
LikeCount: entity.LikeCount,
|
||||||
ReplyCount: entity.ReplyCount,
|
CreatedAt: entity.CreatedAt,
|
||||||
CreatedAt: entity.CreatedAt,
|
UpdatedAt: entity.UpdatedAt,
|
||||||
UpdatedAt: entity.UpdatedAt,
|
|
||||||
}
|
}
|
||||||
list = append(list, item)
|
list = append(list, item)
|
||||||
}
|
}
|
||||||
@@ -177,8 +181,11 @@ func (s *sForumComments) List(ctx context.Context, req *v1.ForumCommentsListReq)
|
|||||||
|
|
||||||
// ForumCommentsDelete 删除评论
|
// ForumCommentsDelete 删除评论
|
||||||
func (s *sForumComments) Delete(ctx context.Context, req *v1.ForumCommentsDeleteReq) (res *v1.ForumCommentsDeleteRes, err error) {
|
func (s *sForumComments) Delete(ctx context.Context, req *v1.ForumCommentsDeleteReq) (res *v1.ForumCommentsDeleteRes, err error) {
|
||||||
// 检查评论是否存在
|
// 检查评论是否存在(排除已删除的)
|
||||||
one, err := dao.ForumComments.Ctx(ctx).WherePri(req.Id).One()
|
one, err := dao.ForumComments.Ctx(ctx).
|
||||||
|
WherePri(req.Id).
|
||||||
|
WhereNull(dao.ForumComments.Columns().DeletedAt).
|
||||||
|
One()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, gerror.Wrap(err, "查询评论失败")
|
return nil, gerror.Wrap(err, "查询评论失败")
|
||||||
}
|
}
|
||||||
@@ -192,27 +199,26 @@ func (s *sForumComments) Delete(ctx context.Context, req *v1.ForumCommentsDelete
|
|||||||
return nil, gerror.Wrap(err, "解析评论数据失败")
|
return nil, gerror.Wrap(err, "解析评论数据失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 软删除评论
|
// 软删除评论:更新 deleted_at 和 status
|
||||||
_, err = dao.ForumComments.Ctx(ctx).WherePri(req.Id).Delete()
|
updateData := map[string]interface{}{
|
||||||
|
dao.ForumComments.Columns().DeletedAt: gtime.Now(),
|
||||||
|
dao.ForumComments.Columns().Status: "deleted",
|
||||||
|
}
|
||||||
|
_, err = dao.ForumComments.Ctx(ctx).WherePri(req.Id).Data(updateData).Update()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, gerror.Wrap(err, "删除评论失败")
|
return nil, gerror.Wrap(err, "删除评论失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新帖子的评论数
|
// 更新帖子的评论数(减少)
|
||||||
if comment.PostId > 0 {
|
if comment.PostId > 0 {
|
||||||
_, err = dao.ForumPosts.Ctx(ctx).WherePri(comment.PostId).OnDuplicate("comment_count", 1).Update()
|
updatePostData := map[string]interface{}{
|
||||||
|
dao.ForumPosts.Columns().CommentCount: gdb.Raw(fmt.Sprintf("GREATEST(0, %s - 1)", dao.ForumPosts.Columns().CommentCount)),
|
||||||
|
}
|
||||||
|
_, err = dao.ForumPosts.Ctx(ctx).WherePri(comment.PostId).Data(updatePostData).Update()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
g.Log().Warning(ctx, "更新帖子评论数失败:", err)
|
g.Log().Warning(ctx, "更新帖子评论数失败:", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果是回复评论,则更新父评论的回复数
|
|
||||||
if comment.ParentId > 0 {
|
|
||||||
_, err = dao.ForumComments.Ctx(ctx).WherePri(comment.ParentId).OnDuplicate("reply_count", 1).Update()
|
|
||||||
if err != nil {
|
|
||||||
g.Log().Warning(ctx, "更新父评论回复数失败:", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return &v1.ForumCommentsDeleteRes{}, nil
|
return &v1.ForumCommentsDeleteRes{}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
package containment
|
package containment
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"github.com/gogf/gf/v2/frame/g"
|
|
||||||
v1 "TrangleAgent/api/containment/v1"
|
v1 "TrangleAgent/api/containment/v1"
|
||||||
"TrangleAgent/internal/model/response"
|
"TrangleAgent/internal/model/response"
|
||||||
"TrangleAgent/internal/service"
|
"TrangleAgent/internal/service"
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/gogf/gf/v2/frame/g"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 收容库相关方法
|
||||||
type sContainment struct{}
|
type sContainment struct{}
|
||||||
|
|
||||||
func New() *sContainment {
|
func New() *sContainment {
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
package department
|
package department
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
v1 "TrangleAgent/api/department/v1"
|
v1 "TrangleAgent/api/department/v1"
|
||||||
"TrangleAgent/internal/dao"
|
"TrangleAgent/internal/dao"
|
||||||
"TrangleAgent/internal/model"
|
"TrangleAgent/internal/model"
|
||||||
"TrangleAgent/internal/service"
|
"TrangleAgent/internal/service"
|
||||||
|
"context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 部门相关方法
|
||||||
type sDepartment struct{}
|
type sDepartment struct{}
|
||||||
|
|
||||||
func New() *sDepartment {
|
func New() *sDepartment {
|
||||||
|
|||||||
@@ -1,182 +0,0 @@
|
|||||||
package fans
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/gogf/gf/v2/os/gtime"
|
|
||||||
v1 "TrangleAgent/api/user/v1"
|
|
||||||
"TrangleAgent/internal/dao"
|
|
||||||
"TrangleAgent/internal/service"
|
|
||||||
)
|
|
||||||
|
|
||||||
type sFans struct{}
|
|
||||||
|
|
||||||
func New() *sFans {
|
|
||||||
return &sFans{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
service.RegisterFans(New())
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansList 获取粉丝列表
|
|
||||||
//
|
|
||||||
// 参数:
|
|
||||||
// - ctx context.Context: 上下文信息
|
|
||||||
// - req *v1.FansListReq: 粉丝列表请求参数
|
|
||||||
//
|
|
||||||
// 返回:
|
|
||||||
// - res *v1.FansListRes: 粉丝列表响应结果
|
|
||||||
// - err error: 错误信息
|
|
||||||
func (s *sFans) FansList(ctx context.Context, req *v1.FansListReq) (res *v1.FansListRes, err error) {
|
|
||||||
// 创建数据库查询模型
|
|
||||||
m := dao.Fans.Ctx(ctx)
|
|
||||||
|
|
||||||
// 根据用户ID查询
|
|
||||||
m = m.Where(dao.Fans.Columns().UserId, req.UserId)
|
|
||||||
|
|
||||||
// 根据状态查询
|
|
||||||
if req.Status != 0 {
|
|
||||||
m = m.Where(dao.Fans.Columns().Status, req.Status)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询总数
|
|
||||||
total, err := m.Count()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分页处理
|
|
||||||
m = m.Page(req.Page, req.PageSize)
|
|
||||||
|
|
||||||
// 查询列表数据
|
|
||||||
var fansList []*v1.FansListItem
|
|
||||||
err = m.Scan(&fansList)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
res = &v1.FansListRes{
|
|
||||||
List: fansList,
|
|
||||||
}
|
|
||||||
|
|
||||||
// 设置分页信息
|
|
||||||
req.PageResult.Total = int(total)
|
|
||||||
req.PageResult.Page = req.Page
|
|
||||||
req.PageResult.PageSize = req.PageSize
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansView 获取粉丝详情
|
|
||||||
//
|
|
||||||
// 参数:
|
|
||||||
// - ctx context.Context: 上下文信息
|
|
||||||
// - req *v1.FansViewReq: 粉丝详情请求参数
|
|
||||||
//
|
|
||||||
// 返回:
|
|
||||||
// - res *v1.FansViewRes: 粉丝详情响应结果
|
|
||||||
// - err error: 错误信息
|
|
||||||
func (s *sFans) FansView(ctx context.Context, req *v1.FansViewReq) (res *v1.FansViewRes, err error) {
|
|
||||||
// 创建数据库查询模型
|
|
||||||
m := dao.Fans.Ctx(ctx)
|
|
||||||
|
|
||||||
// 根据ID查询
|
|
||||||
m = m.Where(dao.Fans.Columns().Id, req.Id)
|
|
||||||
|
|
||||||
res = &v1.FansViewRes{}
|
|
||||||
err = m.Scan(&res.FansListItem)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansUpdate 更新粉丝信息
|
|
||||||
//
|
|
||||||
// 参数:
|
|
||||||
// - ctx context.Context: 上下文信息
|
|
||||||
// - req *v1.FansUpdateReq: 粉丝更新请求参数
|
|
||||||
//
|
|
||||||
// 返回:
|
|
||||||
// - res *v1.FansUpdateRes: 粉丝更新响应结果
|
|
||||||
// - err error: 错误信息
|
|
||||||
func (s *sFans) FansUpdate(ctx context.Context, req *v1.FansUpdateReq) (res *v1.FansUpdateRes, err error) {
|
|
||||||
// 创建数据库查询模型
|
|
||||||
m := dao.Fans.Ctx(ctx)
|
|
||||||
|
|
||||||
// 更新粉丝信息
|
|
||||||
_, err = m.Data(req).Where(dao.Fans.Columns().Id, req.Id).Update()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
res = &v1.FansUpdateRes{
|
|
||||||
Id: req.Id,
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansDelete 删除粉丝关系
|
|
||||||
//
|
|
||||||
// 参数:
|
|
||||||
// - ctx context.Context: 上下文信息
|
|
||||||
// - req *v1.FansDeleteReq: 粉丝删除请求参数
|
|
||||||
//
|
|
||||||
// 返回:
|
|
||||||
// - res *v1.FansDeleteRes: 粉丝删除响应结果
|
|
||||||
// - err error: 错误信息
|
|
||||||
func (s *sFans) FansDelete(ctx context.Context, req *v1.FansDeleteReq) (res *v1.FansDeleteRes, err error) {
|
|
||||||
// 根据ID删除粉丝关系
|
|
||||||
_, err = dao.Fans.Ctx(ctx).Where(dao.Fans.Columns().Id, req.Id).Delete()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
res = &v1.FansDeleteRes{}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// FansCreate 创建粉丝关系
|
|
||||||
//
|
|
||||||
// 参数:
|
|
||||||
// - ctx context.Context: 上下文信息
|
|
||||||
// - req *v1.FansCreateReq: 粉丝创建请求参数
|
|
||||||
//
|
|
||||||
// 返回:
|
|
||||||
// - res *v1.FansCreateRes: 粉丝创建响应结果
|
|
||||||
// - err error: 错误信息
|
|
||||||
func (s *sFans) FansCreate(ctx context.Context, req *v1.FansCreateReq) (res *v1.FansCreateRes, err error) {
|
|
||||||
// 创建数据库查询模型
|
|
||||||
m := dao.Fans.Ctx(ctx)
|
|
||||||
|
|
||||||
// 准备数据
|
|
||||||
data := map[string]interface{}{
|
|
||||||
"user_id": req.UserId,
|
|
||||||
"fan_id": req.FanId,
|
|
||||||
"status": 1, // 默认状态为关注中
|
|
||||||
"remark": req.Remark,
|
|
||||||
"created_at": gtime.Now(),
|
|
||||||
"updated_at": gtime.Now(),
|
|
||||||
}
|
|
||||||
|
|
||||||
// 插入数据
|
|
||||||
result, err := m.Data(data).Insert()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取插入的ID
|
|
||||||
lastInsertId, err := result.LastInsertId()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
res = &v1.FansCreateRes{
|
|
||||||
Id: uint64(lastInsertId),
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
@@ -8,10 +8,8 @@ import (
|
|||||||
_ "TrangleAgent/internal/logic/ForumComments"
|
_ "TrangleAgent/internal/logic/ForumComments"
|
||||||
_ "TrangleAgent/internal/logic/containment"
|
_ "TrangleAgent/internal/logic/containment"
|
||||||
_ "TrangleAgent/internal/logic/department"
|
_ "TrangleAgent/internal/logic/department"
|
||||||
_ "TrangleAgent/internal/logic/fans"
|
|
||||||
_ "TrangleAgent/internal/logic/login"
|
_ "TrangleAgent/internal/logic/login"
|
||||||
_ "TrangleAgent/internal/logic/room"
|
_ "TrangleAgent/internal/logic/room"
|
||||||
_ "TrangleAgent/internal/logic/subscribe"
|
|
||||||
_ "TrangleAgent/internal/logic/trace"
|
_ "TrangleAgent/internal/logic/trace"
|
||||||
_ "TrangleAgent/internal/logic/user"
|
_ "TrangleAgent/internal/logic/user"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
package room
|
package room
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
v1 "TrangleAgent/api/room/v1"
|
v1 "TrangleAgent/api/room/v1"
|
||||||
"TrangleAgent/internal/dao"
|
"TrangleAgent/internal/dao"
|
||||||
"TrangleAgent/internal/model"
|
"TrangleAgent/internal/model"
|
||||||
"TrangleAgent/internal/model/entity"
|
"TrangleAgent/internal/model/entity"
|
||||||
"TrangleAgent/internal/service"
|
"TrangleAgent/internal/service"
|
||||||
|
"context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 房间相关方法
|
||||||
type sRoom struct{}
|
type sRoom struct{}
|
||||||
|
|
||||||
func New() *sRoom {
|
func New() *sRoom {
|
||||||
|
|||||||
@@ -1,146 +0,0 @@
|
|||||||
package subscribe
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
v1 "TrangleAgent/api/user/v1"
|
|
||||||
"TrangleAgent/internal/dao"
|
|
||||||
"TrangleAgent/internal/service"
|
|
||||||
"github.com/gogf/gf/v2/os/gtime"
|
|
||||||
)
|
|
||||||
|
|
||||||
type sSubscribe struct{}
|
|
||||||
|
|
||||||
func New() *sSubscribe {
|
|
||||||
return &sSubscribe{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
service.RegisterSubscribe(New())
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeList 获取关注列表
|
|
||||||
func (s *sSubscribe) SubscribeList(ctx context.Context, req *v1.SubscribeListReq) (res *v1.SubscribeListRes, err error) {
|
|
||||||
// 创建数据库查询模型
|
|
||||||
m := dao.Subscribe.Ctx(ctx)
|
|
||||||
|
|
||||||
// 根据用户ID查询
|
|
||||||
m = m.Where(dao.Subscribe.Columns().UserId, req.UserId)
|
|
||||||
|
|
||||||
// 根据状态查询
|
|
||||||
if req.Status != 0 {
|
|
||||||
m = m.Where(dao.Subscribe.Columns().Status, req.Status)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据被关注用户ID查询
|
|
||||||
if req.FollowId != 0 {
|
|
||||||
m = m.Where(dao.Subscribe.Columns().FollowId, req.FollowId)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询总数
|
|
||||||
total, err := m.Count()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分页处理
|
|
||||||
m = m.Page(req.Page, req.PageSize)
|
|
||||||
|
|
||||||
// 查询列表数据
|
|
||||||
var subscribeList []*v1.SubscribeListItem
|
|
||||||
err = m.Scan(&subscribeList)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
res = &v1.SubscribeListRes{
|
|
||||||
List: subscribeList,
|
|
||||||
}
|
|
||||||
|
|
||||||
// 设置分页信息
|
|
||||||
req.PageResult.Total = int(total)
|
|
||||||
req.PageResult.Page = req.Page
|
|
||||||
req.PageResult.PageSize = req.PageSize
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeView 获取关注详情
|
|
||||||
func (s *sSubscribe) SubscribeView(ctx context.Context, req *v1.SubscribeViewReq) (res *v1.SubscribeViewRes, err error) {
|
|
||||||
// 创建数据库查询模型
|
|
||||||
m := dao.Subscribe.Ctx(ctx)
|
|
||||||
|
|
||||||
// 根据ID查询
|
|
||||||
m = m.Where(dao.Subscribe.Columns().Id, req.Id)
|
|
||||||
|
|
||||||
res = &v1.SubscribeViewRes{}
|
|
||||||
err = m.Scan(&res.SubscribeListItem)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeUpdate 更新关注信息
|
|
||||||
func (s *sSubscribe) SubscribeUpdate(ctx context.Context, req *v1.SubscribeUpdateReq) (res *v1.SubscribeUpdateRes, err error) {
|
|
||||||
// 创建数据库查询模型
|
|
||||||
m := dao.Subscribe.Ctx(ctx)
|
|
||||||
|
|
||||||
// 更新关注信息
|
|
||||||
_, err = m.Data(req).Where(dao.Subscribe.Columns().Id, req.Id).Update()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
res = &v1.SubscribeUpdateRes{
|
|
||||||
Id: req.Id,
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeDelete 删除关注关系
|
|
||||||
func (s *sSubscribe) SubscribeDelete(ctx context.Context, req *v1.SubscribeDeleteReq) (res *v1.SubscribeDeleteRes, err error) {
|
|
||||||
// 根据ID删除关注关系
|
|
||||||
_, err = dao.Subscribe.Ctx(ctx).Where(dao.Subscribe.Columns().Id, req.Id).Delete()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
res = &v1.SubscribeDeleteRes{}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// SubscribeCreate 创建关注关系
|
|
||||||
func (s *sSubscribe) SubscribeCreate(ctx context.Context, req *v1.SubscribeCreateReq) (res *v1.SubscribeCreateRes, err error) {
|
|
||||||
// 创建数据库查询模型
|
|
||||||
m := dao.Subscribe.Ctx(ctx)
|
|
||||||
|
|
||||||
// 准备数据
|
|
||||||
data := map[string]interface{}{
|
|
||||||
"user_id": req.UserId,
|
|
||||||
"follow_id": req.FollowId,
|
|
||||||
"status": 1, // 默认状态为关注中
|
|
||||||
"remark": req.Remark,
|
|
||||||
"created_at": gtime.Now(),
|
|
||||||
"updated_at": gtime.Now(),
|
|
||||||
}
|
|
||||||
|
|
||||||
// 插入数据
|
|
||||||
result, err := m.Data(data).Insert()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取插入的ID
|
|
||||||
lastInsertId, err := result.LastInsertId()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
res = &v1.SubscribeCreateRes{
|
|
||||||
Id: uint64(lastInsertId),
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
// ================================================================================
|
|
||||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|
||||||
// You can delete these comments if you wish manually maintain this interface file.
|
|
||||||
// ================================================================================
|
|
||||||
|
|
||||||
package service
|
|
||||||
|
|
||||||
import (
|
|
||||||
v1 "TrangleAgent/api/user/v1"
|
|
||||||
"context"
|
|
||||||
)
|
|
||||||
|
|
||||||
type (
|
|
||||||
IFans interface {
|
|
||||||
// FansList 获取粉丝列表
|
|
||||||
//
|
|
||||||
// 参数:
|
|
||||||
// - ctx context.Context: 上下文信息
|
|
||||||
// - req *v1.FansListReq: 粉丝列表请求参数
|
|
||||||
//
|
|
||||||
// 返回:
|
|
||||||
// - res *v1.FansListRes: 粉丝列表响应结果
|
|
||||||
// - err error: 错误信息
|
|
||||||
FansList(ctx context.Context, req *v1.FansListReq) (res *v1.FansListRes, err error)
|
|
||||||
// FansView 获取粉丝详情
|
|
||||||
//
|
|
||||||
// 参数:
|
|
||||||
// - ctx context.Context: 上下文信息
|
|
||||||
// - req *v1.FansViewReq: 粉丝详情请求参数
|
|
||||||
//
|
|
||||||
// 返回:
|
|
||||||
// - res *v1.FansViewRes: 粉丝详情响应结果
|
|
||||||
// - err error: 错误信息
|
|
||||||
FansView(ctx context.Context, req *v1.FansViewReq) (res *v1.FansViewRes, err error)
|
|
||||||
// FansUpdate 更新粉丝信息
|
|
||||||
//
|
|
||||||
// 参数:
|
|
||||||
// - ctx context.Context: 上下文信息
|
|
||||||
// - req *v1.FansUpdateReq: 粉丝更新请求参数
|
|
||||||
//
|
|
||||||
// 返回:
|
|
||||||
// - res *v1.FansUpdateRes: 粉丝更新响应结果
|
|
||||||
// - err error: 错误信息
|
|
||||||
FansUpdate(ctx context.Context, req *v1.FansUpdateReq) (res *v1.FansUpdateRes, err error)
|
|
||||||
// FansDelete 删除粉丝关系
|
|
||||||
//
|
|
||||||
// 参数:
|
|
||||||
// - ctx context.Context: 上下文信息
|
|
||||||
// - req *v1.FansDeleteReq: 粉丝删除请求参数
|
|
||||||
//
|
|
||||||
// 返回:
|
|
||||||
// - res *v1.FansDeleteRes: 粉丝删除响应结果
|
|
||||||
// - err error: 错误信息
|
|
||||||
FansDelete(ctx context.Context, req *v1.FansDeleteReq) (res *v1.FansDeleteRes, err error)
|
|
||||||
// FansCreate 创建粉丝关系
|
|
||||||
//
|
|
||||||
// 参数:
|
|
||||||
// - ctx context.Context: 上下文信息
|
|
||||||
// - req *v1.FansCreateReq: 粉丝创建请求参数
|
|
||||||
//
|
|
||||||
// 返回:
|
|
||||||
// - res *v1.FansCreateRes: 粉丝创建响应结果
|
|
||||||
// - err error: 错误信息
|
|
||||||
FansCreate(ctx context.Context, req *v1.FansCreateReq) (res *v1.FansCreateRes, err error)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
localFans IFans
|
|
||||||
)
|
|
||||||
|
|
||||||
func Fans() IFans {
|
|
||||||
if localFans == nil {
|
|
||||||
panic("implement not found for interface IFans, forgot register?")
|
|
||||||
}
|
|
||||||
return localFans
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterFans(i IFans) {
|
|
||||||
localFans = i
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
// ================================================================================
|
|
||||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|
||||||
// You can delete these comments if you wish manually maintain this interface file.
|
|
||||||
// ================================================================================
|
|
||||||
|
|
||||||
package service
|
|
||||||
|
|
||||||
import (
|
|
||||||
v1 "TrangleAgent/api/user/v1"
|
|
||||||
"context"
|
|
||||||
)
|
|
||||||
|
|
||||||
type (
|
|
||||||
ISubscribe interface {
|
|
||||||
// SubscribeList 获取关注列表
|
|
||||||
SubscribeList(ctx context.Context, req *v1.SubscribeListReq) (res *v1.SubscribeListRes, err error)
|
|
||||||
// SubscribeView 获取关注详情
|
|
||||||
SubscribeView(ctx context.Context, req *v1.SubscribeViewReq) (res *v1.SubscribeViewRes, err error)
|
|
||||||
// SubscribeUpdate 更新关注信息
|
|
||||||
SubscribeUpdate(ctx context.Context, req *v1.SubscribeUpdateReq) (res *v1.SubscribeUpdateRes, err error)
|
|
||||||
// SubscribeDelete 删除关注关系
|
|
||||||
SubscribeDelete(ctx context.Context, req *v1.SubscribeDeleteReq) (res *v1.SubscribeDeleteRes, err error)
|
|
||||||
// SubscribeCreate 创建关注关系
|
|
||||||
SubscribeCreate(ctx context.Context, req *v1.SubscribeCreateReq) (res *v1.SubscribeCreateRes, err error)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
localSubscribe ISubscribe
|
|
||||||
)
|
|
||||||
|
|
||||||
func Subscribe() ISubscribe {
|
|
||||||
if localSubscribe == nil {
|
|
||||||
panic("implement not found for interface ISubscribe, forgot register?")
|
|
||||||
}
|
|
||||||
return localSubscribe
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterSubscribe(i ISubscribe) {
|
|
||||||
localSubscribe = i
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import http from './http'
|
|
||||||
|
|
||||||
export const login = (data) => http.post('/login', data)
|
|
||||||
export const register = (data) => http.post('/register', data)
|
|
||||||
export const loginByEmail = (data) => http.post('/login/email', data)
|
|
||||||
export const registerByEmail = (data) => http.post('/register/email', data)
|
|
||||||
export const sendEmailCode = (data) => http.post('/email/send-code', data)
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiDepartmentV1DepartmentDeleteRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiDepartmentV1DepartmentDeleteRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -19,3 +19,4 @@ export function deleteApiDepartmentDelete(params: DeleteApiDepartmentDeleteParam
|
|||||||
export interface DeleteApiDepartmentDeleteParams {
|
export interface DeleteApiDepartmentDeleteParams {
|
||||||
id: number;
|
id: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiDepartmentV1DepartmentListRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiDepartmentV1DepartmentListRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -32,3 +32,4 @@ export interface GetApiDepartmentListParams {
|
|||||||
/** 所属用户ID */
|
/** 所属用户ID */
|
||||||
userId?: number;
|
userId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiDepartmentV1DepartmentViewRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiDepartmentV1DepartmentViewRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -19,3 +19,4 @@ export function getApiDepartmentView(params: GetApiDepartmentViewParams, config?
|
|||||||
export interface GetApiDepartmentViewParams {
|
export interface GetApiDepartmentViewParams {
|
||||||
id: number;
|
id: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiDepartmentV1DepartmentCreateRes, type DeepRequired, type TrangleAgentApiDepartmentV1DepartmentCreateReq } from "../../interface";
|
import { type TrangleAgentApiDepartmentV1DepartmentCreateRes, type DeepRequired, type TrangleAgentApiDepartmentV1DepartmentCreateReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function postApiDepartmentCreate(input?: TrangleAgentApiDepartmentV1DepartmentCreateReq, config?: AxiosRequestConfig) {
|
export function postApiDepartmentCreate(input?: TrangleAgentApiDepartmentV1DepartmentCreateReq, config?: AxiosRequestConfig) {
|
||||||
return request.post<DeepRequired<TrangleAgentApiDepartmentV1DepartmentCreateRes>>(`/api/department/create`, input, config);
|
return request.post<DeepRequired<TrangleAgentApiDepartmentV1DepartmentCreateRes>>(`/api/department/create`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiDepartmentV1DepartmentUpdateRes, type DeepRequired, type TrangleAgentApiDepartmentV1DepartmentUpdateReq } from "../../interface";
|
import { type TrangleAgentApiDepartmentV1DepartmentUpdateRes, type DeepRequired, type TrangleAgentApiDepartmentV1DepartmentUpdateReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function putApiDepartmentUpdate(input?: TrangleAgentApiDepartmentV1DepartmentUpdateReq, config?: AxiosRequestConfig) {
|
export function putApiDepartmentUpdate(input?: TrangleAgentApiDepartmentV1DepartmentUpdateReq, config?: AxiosRequestConfig) {
|
||||||
return request.put<DeepRequired<TrangleAgentApiDepartmentV1DepartmentUpdateRes>>(`/api/department/update`, input, config);
|
return request.put<DeepRequired<TrangleAgentApiDepartmentV1DepartmentUpdateRes>>(`/api/department/update`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiContainmentV1ContainmentRepoDeleteRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Containment Repo Delete
|
|
||||||
* /api/containment/delete
|
|
||||||
*/
|
|
||||||
export function deleteApiContainmentDelete(params: DeleteApiContainmentDeleteParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.delete<DeepRequired<LekeApiContainmentV1ContainmentRepoDeleteRes>>(`/api/containment/delete`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DeleteApiContainmentDeleteParams {
|
|
||||||
/** primary key */
|
|
||||||
id?: number;
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiContainmentV1ContainmentRepoListRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Containment Repo List
|
|
||||||
* /api/containment/list
|
|
||||||
*/
|
|
||||||
export function getApiContainmentList(params: GetApiContainmentListParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
page: params.page,
|
|
||||||
pageSize: params.pageSize,
|
|
||||||
total: params.total,
|
|
||||||
terminalId: params.terminalId,
|
|
||||||
anomalyName: params.anomalyName,
|
|
||||||
agentName: params.agentName,
|
|
||||||
repoName: params.repoName,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<LekeApiContainmentV1ContainmentRepoListRes>>(`/api/containment/list`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiContainmentListParams {
|
|
||||||
page?: number;
|
|
||||||
pageSize?: number;
|
|
||||||
total?: number;
|
|
||||||
/** terminal (散逸端) */
|
|
||||||
terminalId?: number;
|
|
||||||
/** anomaly name */
|
|
||||||
anomalyName?: string;
|
|
||||||
/** agent name */
|
|
||||||
agentName?: string;
|
|
||||||
/** containment repo name */
|
|
||||||
repoName?: string;
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiContainmentV1ContainmentRepoViewRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Containment Repo View
|
|
||||||
* /api/containment/view
|
|
||||||
*/
|
|
||||||
export function getApiContainmentView(params: GetApiContainmentViewParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<LekeApiContainmentV1ContainmentRepoViewRes>>(`/api/containment/view`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiContainmentViewParams {
|
|
||||||
/** primary key */
|
|
||||||
id?: number;
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
export * from "./deleteApiContainmentDelete";
|
|
||||||
export * from "./getApiContainmentList";
|
|
||||||
export * from "./postApiContainmentUpdate";
|
|
||||||
export * from "./getApiContainmentView";
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiContainmentV1ContainmentRepoUpdateRes, type DeepRequired, type LekeApiContainmentV1ContainmentRepoUpdateReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create or Update Containment Repo
|
|
||||||
* /api/containment/update
|
|
||||||
*/
|
|
||||||
export function postApiContainmentUpdate(input?: LekeApiContainmentV1ContainmentRepoUpdateReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<LekeApiContainmentV1ContainmentRepoUpdateRes>>(`/api/containment/update`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiLoginV1LogoutRes, type DeepRequired, type TrangleAgentApiLoginV1LogoutReq } from "../../interface";
|
import { type TrangleAgentApiLoginV1LogoutRes, type DeepRequired, type TrangleAgentApiLoginV1LogoutReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function postApiLogout(input?: TrangleAgentApiLoginV1LogoutReq, config?: AxiosRequestConfig) {
|
export function postApiLogout(input?: TrangleAgentApiLoginV1LogoutReq, config?: AxiosRequestConfig) {
|
||||||
return request.post<DeepRequired<TrangleAgentApiLoginV1LogoutRes>>(`/api/logout`, input, config);
|
return request.post<DeepRequired<TrangleAgentApiLoginV1LogoutRes>>(`/api/logout`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiLoginV1LoginRes, type DeepRequired, type TrangleAgentApiLoginV1LoginReq } from "../../interface";
|
import { type TrangleAgentApiLoginV1LoginRes, type DeepRequired, type TrangleAgentApiLoginV1LoginReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function postApiLogin(input?: TrangleAgentApiLoginV1LoginReq, config?: AxiosRequestConfig) {
|
export function postApiLogin(input?: TrangleAgentApiLoginV1LoginReq, config?: AxiosRequestConfig) {
|
||||||
return request.post<DeepRequired<TrangleAgentApiLoginV1LoginRes>>(`/api/login`, input, config);
|
return request.post<DeepRequired<TrangleAgentApiLoginV1LoginRes>>(`/api/login`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiLoginV1LoginByEmailRes, type DeepRequired, type TrangleAgentApiLoginV1LoginByEmailReq } from "../../interface";
|
import { type TrangleAgentApiLoginV1LoginByEmailRes, type DeepRequired, type TrangleAgentApiLoginV1LoginByEmailReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function postApiLoginEmail(input?: TrangleAgentApiLoginV1LoginByEmailReq, config?: AxiosRequestConfig) {
|
export function postApiLoginEmail(input?: TrangleAgentApiLoginV1LoginByEmailReq, config?: AxiosRequestConfig) {
|
||||||
return request.post<DeepRequired<TrangleAgentApiLoginV1LoginByEmailRes>>(`/api/login/email`, input, config);
|
return request.post<DeepRequired<TrangleAgentApiLoginV1LoginByEmailRes>>(`/api/login/email`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiDepartmentV1DepartmentDeleteRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Department Delete
|
|
||||||
* /api/department/delete
|
|
||||||
*/
|
|
||||||
export function deleteApiDepartmentDelete(params: DeleteApiDepartmentDeleteParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.delete<DeepRequired<LekeApiDepartmentV1DepartmentDeleteRes>>(`/api/department/delete`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DeleteApiDepartmentDeleteParams {
|
|
||||||
id: number;
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiDepartmentV1DepartmentListRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Department List
|
|
||||||
* /api/department/list
|
|
||||||
*/
|
|
||||||
export function getApiDepartmentList(params: GetApiDepartmentListParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
page: params.page,
|
|
||||||
pageSize: params.pageSize,
|
|
||||||
total: params.total,
|
|
||||||
branchName: params.branchName,
|
|
||||||
managerName: params.managerName,
|
|
||||||
userId: params.userId,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<LekeApiDepartmentV1DepartmentListRes>>(`/api/department/list`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiDepartmentListParams {
|
|
||||||
page?: number;
|
|
||||||
pageSize?: number;
|
|
||||||
total?: number;
|
|
||||||
/** 分部名称 */
|
|
||||||
branchName?: string;
|
|
||||||
/** 分部经理名称 */
|
|
||||||
managerName?: string;
|
|
||||||
/** 所属用户ID */
|
|
||||||
userId?: number;
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiDepartmentV1DepartmentViewRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Department View
|
|
||||||
* /api/department/view
|
|
||||||
*/
|
|
||||||
export function getApiDepartmentView(params: GetApiDepartmentViewParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<LekeApiDepartmentV1DepartmentViewRes>>(`/api/department/view`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiDepartmentViewParams {
|
|
||||||
id: number;
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export * from "./postApiDepartmentCreate";
|
|
||||||
export * from "./deleteApiDepartmentDelete";
|
|
||||||
export * from "./getApiDepartmentList";
|
|
||||||
export * from "./putApiDepartmentUpdate";
|
|
||||||
export * from "./getApiDepartmentView";
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiDepartmentV1DepartmentCreateRes, type DeepRequired, type LekeApiDepartmentV1DepartmentCreateReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Department Create
|
|
||||||
* /api/department/create
|
|
||||||
*/
|
|
||||||
export function postApiDepartmentCreate(input?: LekeApiDepartmentV1DepartmentCreateReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<LekeApiDepartmentV1DepartmentCreateRes>>(`/api/department/create`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiDepartmentV1DepartmentUpdateRes, type DeepRequired, type LekeApiDepartmentV1DepartmentUpdateReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Department Update
|
|
||||||
* /api/department/update
|
|
||||||
*/
|
|
||||||
export function putApiDepartmentUpdate(input?: LekeApiDepartmentV1DepartmentUpdateReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.put<DeepRequired<LekeApiDepartmentV1DepartmentUpdateRes>>(`/api/department/update`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from "./postApiEmailSendCode";
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiLoginV1SendVerificationCodeRes, type DeepRequired, type LekeApiLoginV1SendVerificationCodeReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send Verification Code
|
|
||||||
* /api/email/send-code
|
|
||||||
*/
|
|
||||||
export function postApiEmailSendCode(input?: LekeApiLoginV1SendVerificationCodeReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<LekeApiLoginV1SendVerificationCodeRes>>(`/api/email/send-code`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiRoomV1RoomDeleteRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiRoomV1RoomDeleteRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -20,3 +20,4 @@ export interface DeleteApiRoomDeleteParams {
|
|||||||
/** 房间号 */
|
/** 房间号 */
|
||||||
room_code?: string;
|
room_code?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiRoomV1RoomListRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiRoomV1RoomListRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -38,3 +38,4 @@ export interface GetApiRoomListParams {
|
|||||||
/** 规则系统,如COC、DND5E */
|
/** 规则系统,如COC、DND5E */
|
||||||
system_name?: string;
|
system_name?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiRoomV1RoomViewRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiRoomV1RoomViewRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -23,3 +23,4 @@ export interface GetApiRoomViewParams {
|
|||||||
/** 房间号 */
|
/** 房间号 */
|
||||||
room_code?: string;
|
room_code?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiRoomV1RoomCreateRes, type DeepRequired, type TrangleAgentApiRoomV1RoomCreateReq } from "../../interface";
|
import { type TrangleAgentApiRoomV1RoomCreateRes, type DeepRequired, type TrangleAgentApiRoomV1RoomCreateReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiRoomV1RoomJoinRes, type DeepRequired, type TrangleAgentApiRoomV1RoomJoinReq } from "../../interface";
|
import { type TrangleAgentApiRoomV1RoomJoinRes, type DeepRequired, type TrangleAgentApiRoomV1RoomJoinReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function postApiRoomJoin(input?: TrangleAgentApiRoomV1RoomJoinReq, config?: AxiosRequestConfig) {
|
export function postApiRoomJoin(input?: TrangleAgentApiRoomV1RoomJoinReq, config?: AxiosRequestConfig) {
|
||||||
return request.post<DeepRequired<TrangleAgentApiRoomV1RoomJoinRes>>(`/api/room/join`, input, config);
|
return request.post<DeepRequired<TrangleAgentApiRoomV1RoomJoinRes>>(`/api/room/join`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiRoomV1RoomUpdateRes, type DeepRequired, type TrangleAgentApiRoomV1RoomUpdateReq } from "../../interface";
|
import { type TrangleAgentApiRoomV1RoomUpdateRes, type DeepRequired, type TrangleAgentApiRoomV1RoomUpdateReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function putApiRoomUpdate(input?: TrangleAgentApiRoomV1RoomUpdateReq, config?: AxiosRequestConfig) {
|
export function putApiRoomUpdate(input?: TrangleAgentApiRoomV1RoomUpdateReq, config?: AxiosRequestConfig) {
|
||||||
return request.put<DeepRequired<TrangleAgentApiRoomV1RoomUpdateRes>>(`/api/room/update`, input, config);
|
return request.put<DeepRequired<TrangleAgentApiRoomV1RoomUpdateRes>>(`/api/room/update`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiUserV1FansDeleteRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fans Delete
|
|
||||||
* /api/fans/delete
|
|
||||||
*/
|
|
||||||
export function deleteApiFansDelete(params: DeleteApiFansDeleteParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.delete<DeepRequired<LekeApiUserV1FansDeleteRes>>(`/api/fans/delete`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DeleteApiFansDeleteParams {
|
|
||||||
id: number;
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiUserV1FansListRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fans List
|
|
||||||
* /api/fans/list
|
|
||||||
*/
|
|
||||||
export function getApiFansList(params: GetApiFansListParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
page: params.page,
|
|
||||||
pageSize: params.pageSize,
|
|
||||||
total: params.total,
|
|
||||||
userId: params.userId,
|
|
||||||
status: params.status,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<LekeApiUserV1FansListRes>>(`/api/fans/list`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiFansListParams {
|
|
||||||
page?: number;
|
|
||||||
pageSize?: number;
|
|
||||||
total?: number;
|
|
||||||
userId: number;
|
|
||||||
/** 状态:1=粉丝 0=取关/无效 */
|
|
||||||
status?: number;
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiUserV1FansViewRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fans View
|
|
||||||
* /api/fans/view
|
|
||||||
*/
|
|
||||||
export function getApiFansView(params: GetApiFansViewParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<LekeApiUserV1FansViewRes>>(`/api/fans/view`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiFansViewParams {
|
|
||||||
id: number;
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export * from "./postApiFansCreate";
|
|
||||||
export * from "./deleteApiFansDelete";
|
|
||||||
export * from "./getApiFansList";
|
|
||||||
export * from "./putApiFansUpdate";
|
|
||||||
export * from "./getApiFansView";
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiUserV1FansCreateRes, type DeepRequired, type LekeApiUserV1FansCreateReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fans Create
|
|
||||||
* /api/fans/create
|
|
||||||
*/
|
|
||||||
export function postApiFansCreate(input?: LekeApiUserV1FansCreateReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<LekeApiUserV1FansCreateRes>>(`/api/fans/create`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiUserV1FansUpdateRes, type DeepRequired, type LekeApiUserV1FansUpdateReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fans Update
|
|
||||||
* /api/fans/update
|
|
||||||
*/
|
|
||||||
export function putApiFansUpdate(input?: LekeApiUserV1FansUpdateReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.put<DeepRequired<LekeApiUserV1FansUpdateRes>>(`/api/fans/update`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import request from "./src/api/http.js";
|
|
||||||
import { type TrangleAgentApiUserV1FansDeleteRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除粉丝
|
|
||||||
* /api/fans/delete
|
|
||||||
*/
|
|
||||||
export function deleteApiFansDelete(params: DeleteApiFansDeleteParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.delete<DeepRequired<TrangleAgentApiUserV1FansDeleteRes>>(`/api/fans/delete`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DeleteApiFansDeleteParams {
|
|
||||||
id: number;
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
import request from "./src/api/http.js";
|
|
||||||
import { type TrangleAgentApiUserV1FansListRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 粉丝列表
|
|
||||||
* /api/fans/list
|
|
||||||
*/
|
|
||||||
export function getApiFansList(params: GetApiFansListParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
page: params.page,
|
|
||||||
pageSize: params.pageSize,
|
|
||||||
total: params.total,
|
|
||||||
userId: params.userId,
|
|
||||||
status: params.status,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<TrangleAgentApiUserV1FansListRes>>(`/api/fans/list`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiFansListParams {
|
|
||||||
page?: number;
|
|
||||||
pageSize?: number;
|
|
||||||
total?: number;
|
|
||||||
userId: number;
|
|
||||||
/** 状态:1=粉丝 0=取关/无效 */
|
|
||||||
status?: number;
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import request from "./src/api/http.js";
|
|
||||||
import { type TrangleAgentApiUserV1FansViewRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 粉丝详情
|
|
||||||
* /api/fans/view
|
|
||||||
*/
|
|
||||||
export function getApiFansView(params: GetApiFansViewParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<TrangleAgentApiUserV1FansViewRes>>(`/api/fans/view`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiFansViewParams {
|
|
||||||
id: number;
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export * from "./postApiFansCreate";
|
|
||||||
export * from "./deleteApiFansDelete";
|
|
||||||
export * from "./getApiFansList";
|
|
||||||
export * from "./putApiFansUpdate";
|
|
||||||
export * from "./getApiFansView";
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "./src/api/http.js";
|
|
||||||
import { type TrangleAgentApiUserV1FansCreateRes, type DeepRequired, type TrangleAgentApiUserV1FansCreateReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建粉丝
|
|
||||||
* /api/fans/create
|
|
||||||
*/
|
|
||||||
export function postApiFansCreate(input?: TrangleAgentApiUserV1FansCreateReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<TrangleAgentApiUserV1FansCreateRes>>(`/api/fans/create`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "./src/api/http.js";
|
|
||||||
import { type TrangleAgentApiUserV1FansUpdateRes, type DeepRequired, type TrangleAgentApiUserV1FansUpdateReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新粉丝
|
|
||||||
* /api/fans/update
|
|
||||||
*/
|
|
||||||
export function putApiFansUpdate(input?: TrangleAgentApiUserV1FansUpdateReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.put<DeepRequired<TrangleAgentApiUserV1FansUpdateRes>>(`/api/fans/update`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import request from "./src/api/http.js";
|
|
||||||
import { type TrangleAgentApiUserV1SubscribeDeleteRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除关注
|
|
||||||
* /api/subscribe/delete
|
|
||||||
*/
|
|
||||||
export function deleteApiSubscribeDelete(params: DeleteApiSubscribeDeleteParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.delete<DeepRequired<TrangleAgentApiUserV1SubscribeDeleteRes>>(`/api/subscribe/delete`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DeleteApiSubscribeDeleteParams {
|
|
||||||
id: number;
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
import request from "./src/api/http.js";
|
|
||||||
import { type TrangleAgentApiUserV1SubscribeListRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关注列表
|
|
||||||
* /api/subscribe/list
|
|
||||||
*/
|
|
||||||
export function getApiSubscribeList(params: GetApiSubscribeListParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
page: params.page,
|
|
||||||
pageSize: params.pageSize,
|
|
||||||
total: params.total,
|
|
||||||
userId: params.userId,
|
|
||||||
status: params.status,
|
|
||||||
followId: params.followId,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<TrangleAgentApiUserV1SubscribeListRes>>(`/api/subscribe/list`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiSubscribeListParams {
|
|
||||||
page?: number;
|
|
||||||
pageSize?: number;
|
|
||||||
total?: number;
|
|
||||||
userId: number;
|
|
||||||
/** 状态:1=关注中 0=取消关注 */
|
|
||||||
status?: number;
|
|
||||||
/** 被关注的用户ID */
|
|
||||||
followId?: number;
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import request from "./src/api/http.js";
|
|
||||||
import { type TrangleAgentApiUserV1SubscribeViewRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关注详情
|
|
||||||
* /api/subscribe/view
|
|
||||||
*/
|
|
||||||
export function getApiSubscribeView(params: GetApiSubscribeViewParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<TrangleAgentApiUserV1SubscribeViewRes>>(`/api/subscribe/view`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiSubscribeViewParams {
|
|
||||||
id: number;
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export * from "./postApiSubscribeCreate";
|
|
||||||
export * from "./deleteApiSubscribeDelete";
|
|
||||||
export * from "./getApiSubscribeList";
|
|
||||||
export * from "./putApiSubscribeUpdate";
|
|
||||||
export * from "./getApiSubscribeView";
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "./src/api/http.js";
|
|
||||||
import { type TrangleAgentApiUserV1SubscribeCreateRes, type DeepRequired, type TrangleAgentApiUserV1SubscribeCreateReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建关注
|
|
||||||
* /api/subscribe/create
|
|
||||||
*/
|
|
||||||
export function postApiSubscribeCreate(input?: TrangleAgentApiUserV1SubscribeCreateReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<TrangleAgentApiUserV1SubscribeCreateRes>>(`/api/subscribe/create`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "./src/api/http.js";
|
|
||||||
import { type TrangleAgentApiUserV1SubscribeUpdateRes, type DeepRequired, type TrangleAgentApiUserV1SubscribeUpdateReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新关注
|
|
||||||
* /api/subscribe/update
|
|
||||||
*/
|
|
||||||
export function putApiSubscribeUpdate(input?: TrangleAgentApiUserV1SubscribeUpdateReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.put<DeepRequired<TrangleAgentApiUserV1SubscribeUpdateRes>>(`/api/subscribe/update`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiUserV1TraceReduceRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiUserV1TraceReduceRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -29,3 +29,4 @@ export interface DeleteApiTraceReduceParams {
|
|||||||
/** 蓝轨 */
|
/** 蓝轨 */
|
||||||
blueTrace?: number;
|
blueTrace?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiUserV1TraceListRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiUserV1TraceListRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -41,3 +41,4 @@ export interface GetApiTraceListParams {
|
|||||||
/** 蓝轨 */
|
/** 蓝轨 */
|
||||||
blueTrace?: number;
|
blueTrace?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiUserV1TraceViewRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiUserV1TraceViewRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -29,3 +29,4 @@ export interface GetApiTraceViewParams {
|
|||||||
/** 蓝轨 */
|
/** 蓝轨 */
|
||||||
blueTrace?: number;
|
blueTrace?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiUserV1TraceUpdateRes, type DeepRequired, type TrangleAgentApiUserV1TraceUpdateReq } from "../../interface";
|
import { type TrangleAgentApiUserV1TraceUpdateRes, type DeepRequired, type TrangleAgentApiUserV1TraceUpdateReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function putApiTraceUpdate(input?: TrangleAgentApiUserV1TraceUpdateReq, config?: AxiosRequestConfig) {
|
export function putApiTraceUpdate(input?: TrangleAgentApiUserV1TraceUpdateReq, config?: AxiosRequestConfig) {
|
||||||
return request.put<DeepRequired<TrangleAgentApiUserV1TraceUpdateRes>>(`/api/trace/update`, input, config);
|
return request.put<DeepRequired<TrangleAgentApiUserV1TraceUpdateRes>>(`/api/trace/update`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiUserV1RoleDeleteRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiUserV1RoleDeleteRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -20,3 +20,4 @@ export interface DeleteApiRoleDeleteParams {
|
|||||||
/** 角色ID */
|
/** 角色ID */
|
||||||
id: number;
|
id: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiUserV1RoleListRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiUserV1RoleListRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -29,3 +29,4 @@ export interface GetApiRoleListParams {
|
|||||||
/** 部门ID */
|
/** 部门ID */
|
||||||
departmentId?: number;
|
departmentId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiUserV1RoleViewRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiUserV1RoleViewRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -20,3 +20,4 @@ export interface GetApiRoleViewParams {
|
|||||||
/** 角色ID */
|
/** 角色ID */
|
||||||
id: number;
|
id: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiUserV1RoleCreateRes, type DeepRequired, type TrangleAgentApiUserV1RoleCreateReq } from "../../interface";
|
import { type TrangleAgentApiUserV1RoleCreateRes, type DeepRequired, type TrangleAgentApiUserV1RoleCreateReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function postApiRoleCreate(input?: TrangleAgentApiUserV1RoleCreateReq, config?: AxiosRequestConfig) {
|
export function postApiRoleCreate(input?: TrangleAgentApiUserV1RoleCreateReq, config?: AxiosRequestConfig) {
|
||||||
return request.post<DeepRequired<TrangleAgentApiUserV1RoleCreateRes>>(`/api/role/create`, input, config);
|
return request.post<DeepRequired<TrangleAgentApiUserV1RoleCreateRes>>(`/api/role/create`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiUserV1RolePermissionCheckRes, type DeepRequired, type TrangleAgentApiUserV1RolePermissionCheckReq } from "../../interface";
|
import { type TrangleAgentApiUserV1RolePermissionCheckRes, type DeepRequired, type TrangleAgentApiUserV1RolePermissionCheckReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function postApiRolePermissionCheck(input?: TrangleAgentApiUserV1RolePermissionCheckReq, config?: AxiosRequestConfig) {
|
export function postApiRolePermissionCheck(input?: TrangleAgentApiUserV1RolePermissionCheckReq, config?: AxiosRequestConfig) {
|
||||||
return request.post<DeepRequired<TrangleAgentApiUserV1RolePermissionCheckRes>>(`/api/role/permission/check`, input, config);
|
return request.post<DeepRequired<TrangleAgentApiUserV1RolePermissionCheckRes>>(`/api/role/permission/check`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiUserV1RoleUpdateRes, type DeepRequired, type TrangleAgentApiUserV1RoleUpdateReq } from "../../interface";
|
import { type TrangleAgentApiUserV1RoleUpdateRes, type DeepRequired, type TrangleAgentApiUserV1RoleUpdateReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function putApiRoleUpdate(input?: TrangleAgentApiUserV1RoleUpdateReq, config?: AxiosRequestConfig) {
|
export function putApiRoleUpdate(input?: TrangleAgentApiUserV1RoleUpdateReq, config?: AxiosRequestConfig) {
|
||||||
return request.put<DeepRequired<TrangleAgentApiUserV1RoleUpdateRes>>(`/api/role/update`, input, config);
|
return request.put<DeepRequired<TrangleAgentApiUserV1RoleUpdateRes>>(`/api/role/update`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
export * from "./postApiLogin";
|
|
||||||
export * from "./postApiLoginEmail";
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiLoginV1LoginRes, type DeepRequired, type LekeApiLoginV1LoginReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* User Login
|
|
||||||
* /api/login
|
|
||||||
*/
|
|
||||||
export function postApiLogin(input?: LekeApiLoginV1LoginReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<LekeApiLoginV1LoginRes>>(`/api/login`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiLoginV1LoginByEmailRes, type DeepRequired, type LekeApiLoginV1LoginByEmailReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* User Login By Email
|
|
||||||
* /api/login/email
|
|
||||||
*/
|
|
||||||
export function postApiLoginEmail(input?: LekeApiLoginV1LoginByEmailReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<LekeApiLoginV1LoginByEmailRes>>(`/api/login/email`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from "./postApiLogout";
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiLoginV1LogoutRes, type DeepRequired, type LekeApiLoginV1LogoutReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* User Logout
|
|
||||||
* /api/logout
|
|
||||||
*/
|
|
||||||
export function postApiLogout(input?: LekeApiLoginV1LogoutReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<LekeApiLoginV1LogoutRes>>(`/api/logout`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiForumV1ForumCommentsDeleteRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiForumV1ForumCommentsDeleteRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -20,3 +20,4 @@ export interface DeleteApiForumCommentsDeleteParams {
|
|||||||
/** 评论ID */
|
/** 评论ID */
|
||||||
id?: number;
|
id?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiForumV1ForumCommentsListRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiForumV1ForumCommentsListRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -35,3 +35,4 @@ export interface GetApiForumCommentsListParams {
|
|||||||
/** 评论状态 */
|
/** 评论状态 */
|
||||||
status?: string;
|
status?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiForumV1ForumCommentsViewRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiForumV1ForumCommentsViewRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -20,3 +20,4 @@ export interface GetApiForumCommentsViewParams {
|
|||||||
/** 评论ID */
|
/** 评论ID */
|
||||||
id?: number;
|
id?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiForumV1ForumCommentsCreateRes, type DeepRequired, type TrangleAgentApiForumV1ForumCommentsCreateReq } from "../../interface";
|
import { type TrangleAgentApiForumV1ForumCommentsCreateRes, type DeepRequired, type TrangleAgentApiForumV1ForumCommentsCreateReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function postApiForumCommentsCreate(input?: TrangleAgentApiForumV1ForumCommentsCreateReq, config?: AxiosRequestConfig) {
|
export function postApiForumCommentsCreate(input?: TrangleAgentApiForumV1ForumCommentsCreateReq, config?: AxiosRequestConfig) {
|
||||||
return request.post<DeepRequired<TrangleAgentApiForumV1ForumCommentsCreateRes>>(`/api/forum/comments/create`, input, config);
|
return request.post<DeepRequired<TrangleAgentApiForumV1ForumCommentsCreateRes>>(`/api/forum/comments/create`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiForumV1ForumCommentsUpdateRes, type DeepRequired, type TrangleAgentApiForumV1ForumCommentsUpdateReq } from "../../interface";
|
import { type TrangleAgentApiForumV1ForumCommentsUpdateRes, type DeepRequired, type TrangleAgentApiForumV1ForumCommentsUpdateReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function putApiForumCommentsUpdate(input?: TrangleAgentApiForumV1ForumCommentsUpdateReq, config?: AxiosRequestConfig) {
|
export function putApiForumCommentsUpdate(input?: TrangleAgentApiForumV1ForumCommentsUpdateReq, config?: AxiosRequestConfig) {
|
||||||
return request.put<DeepRequired<TrangleAgentApiForumV1ForumCommentsUpdateRes>>(`/api/forum/comments/update`, input, config);
|
return request.put<DeepRequired<TrangleAgentApiForumV1ForumCommentsUpdateRes>>(`/api/forum/comments/update`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiForumV1ForumPostsDeleteRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiForumV1ForumPostsDeleteRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -20,3 +20,4 @@ export interface DeleteApiForumPostsDeleteParams {
|
|||||||
/** 帖子ID */
|
/** 帖子ID */
|
||||||
id?: number;
|
id?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiForumV1ForumPostsListRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiForumV1ForumPostsListRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -32,3 +32,4 @@ export interface GetApiForumPostsListParams {
|
|||||||
/** 帖子状态 */
|
/** 帖子状态 */
|
||||||
status?: string;
|
status?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiForumV1ForumPostsViewRes, type DeepRequired } from "../../interface";
|
import { type TrangleAgentApiForumV1ForumPostsViewRes, type DeepRequired } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -20,3 +20,4 @@ export interface GetApiForumPostsViewParams {
|
|||||||
/** 帖子ID */
|
/** 帖子ID */
|
||||||
id?: number;
|
id?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiForumV1ForumPostsCreateRes, type DeepRequired, type TrangleAgentApiForumV1ForumPostsCreateReq } from "../../interface";
|
import { type TrangleAgentApiForumV1ForumPostsCreateRes, type DeepRequired, type TrangleAgentApiForumV1ForumPostsCreateReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function postApiForumPostsCreate(input?: TrangleAgentApiForumV1ForumPostsCreateReq, config?: AxiosRequestConfig) {
|
export function postApiForumPostsCreate(input?: TrangleAgentApiForumV1ForumPostsCreateReq, config?: AxiosRequestConfig) {
|
||||||
return request.post<DeepRequired<TrangleAgentApiForumV1ForumPostsCreateRes>>(`/api/forum/posts/create`, input, config);
|
return request.post<DeepRequired<TrangleAgentApiForumV1ForumPostsCreateRes>>(`/api/forum/posts/create`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from "./src/api/http.js";
|
import request from "../../http.js";
|
||||||
import { type TrangleAgentApiForumV1ForumPostsUpdateRes, type DeepRequired, type TrangleAgentApiForumV1ForumPostsUpdateReq } from "../../interface";
|
import { type TrangleAgentApiForumV1ForumPostsUpdateRes, type DeepRequired, type TrangleAgentApiForumV1ForumPostsUpdateReq } from "../../interface";
|
||||||
import { type AxiosRequestConfig } from "axios";
|
import { type AxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
@@ -9,3 +9,4 @@ import { type AxiosRequestConfig } from "axios";
|
|||||||
export function putApiForumPostsUpdate(input?: TrangleAgentApiForumV1ForumPostsUpdateReq, config?: AxiosRequestConfig) {
|
export function putApiForumPostsUpdate(input?: TrangleAgentApiForumV1ForumPostsUpdateReq, config?: AxiosRequestConfig) {
|
||||||
return request.put<DeepRequired<TrangleAgentApiForumV1ForumPostsUpdateRes>>(`/api/forum/posts/update`, input, config);
|
return request.put<DeepRequired<TrangleAgentApiForumV1ForumPostsUpdateRes>>(`/api/forum/posts/update`, input, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
export * from "./postApiRegister";
|
|
||||||
export * from "./postApiRegisterEmail";
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiLoginV1RegisterRes, type DeepRequired, type LekeApiLoginV1RegisterReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* User Register
|
|
||||||
* /api/register
|
|
||||||
*/
|
|
||||||
export function postApiRegister(input?: LekeApiLoginV1RegisterReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<LekeApiLoginV1RegisterRes>>(`/api/register`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiLoginV1RegisterByEmailRes, type DeepRequired, type LekeApiLoginV1RegisterByEmailReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* User Register By Email
|
|
||||||
* /api/register/email
|
|
||||||
*/
|
|
||||||
export function postApiRegisterEmail(input?: LekeApiLoginV1RegisterByEmailReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<LekeApiLoginV1RegisterByEmailRes>>(`/api/register/email`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiUserV1RoleDeleteRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete Role
|
|
||||||
* /api/role/delete
|
|
||||||
*/
|
|
||||||
export function deleteApiRoleDelete(params: DeleteApiRoleDeleteParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.delete<DeepRequired<LekeApiUserV1RoleDeleteRes>>(`/api/role/delete`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DeleteApiRoleDeleteParams {
|
|
||||||
/** 角色ID */
|
|
||||||
id: number;
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiUserV1RoleListRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Role List
|
|
||||||
* /api/role/list
|
|
||||||
*/
|
|
||||||
export function getApiRoleList(params: GetApiRoleListParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
page: params.page,
|
|
||||||
pageSize: params.pageSize,
|
|
||||||
total: params.total,
|
|
||||||
userId: params.userId,
|
|
||||||
departmentId: params.departmentId,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<LekeApiUserV1RoleListRes>>(`/role/list`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiRoleListParams {
|
|
||||||
page?: number;
|
|
||||||
pageSize?: number;
|
|
||||||
total?: number;
|
|
||||||
/** 用户ID */
|
|
||||||
userId?: number;
|
|
||||||
/** 部门ID */
|
|
||||||
departmentId?: number;
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiUserV1RoleViewRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* View Role
|
|
||||||
* /api/role/view
|
|
||||||
*/
|
|
||||||
export function getApiRoleView(params: GetApiRoleViewParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<LekeApiUserV1RoleViewRes>>(`/api/role/view`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiRoleViewParams {
|
|
||||||
/** 角色ID */
|
|
||||||
id: number;
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
export * from "./postApiRoleCreate";
|
|
||||||
export * from "./deleteApiRoleDelete";
|
|
||||||
export * from "./getApiRoleList";
|
|
||||||
export * from "./postApiRolePermissionCheck";
|
|
||||||
export * from "./putApiRoleUpdate";
|
|
||||||
export * from "./getApiRoleView";
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiUserV1RoleCreateRes, type DeepRequired, type LekeApiUserV1RoleCreateReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create Role
|
|
||||||
* /api/role/create
|
|
||||||
*/
|
|
||||||
export function postApiRoleCreate(input?: LekeApiUserV1RoleCreateReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<LekeApiUserV1RoleCreateRes>>(`/api/role/create`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiUserV1RolePermissionCheckRes, type DeepRequired, type LekeApiUserV1RolePermissionCheckReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check Role Permission
|
|
||||||
* /api/role/permission/check
|
|
||||||
*/
|
|
||||||
export function postApiRolePermissionCheck(input?: LekeApiUserV1RolePermissionCheckReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.post<DeepRequired<LekeApiUserV1RolePermissionCheckRes>>(`/api/role/permission/check`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiUserV1RoleUpdateRes, type DeepRequired, type LekeApiUserV1RoleUpdateReq } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update Role
|
|
||||||
* /api/role/update
|
|
||||||
*/
|
|
||||||
export function putApiRoleUpdate(input?: LekeApiUserV1RoleUpdateReq, config?: AxiosRequestConfig) {
|
|
||||||
return request.put<DeepRequired<LekeApiUserV1RoleUpdateRes>>(`/api/role/update`, input, config);
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiRoomV1RoomDeleteRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Room Delete
|
|
||||||
* /api/room/delete
|
|
||||||
*/
|
|
||||||
export function deleteApiRoomDelete(params: DeleteApiRoomDeleteParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
room_code: params.room_code,
|
|
||||||
};
|
|
||||||
return request.delete<DeepRequired<LekeApiRoomV1RoomDeleteRes>>(`/api/room/delete`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DeleteApiRoomDeleteParams {
|
|
||||||
/** 房间号 */
|
|
||||||
room_code?: string;
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiRoomV1RoomListRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Room List
|
|
||||||
* /api/room/list
|
|
||||||
*/
|
|
||||||
export function getApiRoomList(params: GetApiRoomListParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
page: params.page,
|
|
||||||
pageSize: params.pageSize,
|
|
||||||
total: params.total,
|
|
||||||
room_code: params.room_code,
|
|
||||||
room_name: params.room_name,
|
|
||||||
host_id: params.host_id,
|
|
||||||
status: params.status,
|
|
||||||
system_name: params.system_name,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<LekeApiRoomV1RoomListRes>>(`/api/room/list`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiRoomListParams {
|
|
||||||
page?: number;
|
|
||||||
pageSize?: number;
|
|
||||||
total?: number;
|
|
||||||
/** 房间号 */
|
|
||||||
room_code?: string;
|
|
||||||
/** 房间名称 */
|
|
||||||
room_name?: string;
|
|
||||||
/** 主持人用户ID */
|
|
||||||
host_id?: number;
|
|
||||||
/** 房间状态:0未开始 1进行中 2已结束 3已关闭 */
|
|
||||||
status?: number;
|
|
||||||
/** 规则系统,如COC、DND5E */
|
|
||||||
system_name?: string;
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import request from "../../http.js";
|
|
||||||
import { type LekeApiRoomV1RoomViewRes, type DeepRequired } from "../../interface";
|
|
||||||
import { type AxiosRequestConfig } from "axios";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Room View
|
|
||||||
* /api/room/view
|
|
||||||
*/
|
|
||||||
export function getApiRoomView(params: GetApiRoomViewParams, config?: AxiosRequestConfig) {
|
|
||||||
const paramsInput = {
|
|
||||||
id: params.id,
|
|
||||||
room_code: params.room_code,
|
|
||||||
};
|
|
||||||
return request.get<DeepRequired<LekeApiRoomV1RoomViewRes>>(`/api/room/view`, {
|
|
||||||
params: paramsInput,
|
|
||||||
...config,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApiRoomViewParams {
|
|
||||||
/** 房间ID */
|
|
||||||
id?: number;
|
|
||||||
/** 房间号 */
|
|
||||||
room_code?: string;
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export * from "./postApiRoomCreate";
|
|
||||||
export * from "./deleteApiRoomDelete";
|
|
||||||
export * from "./getApiRoomList";
|
|
||||||
export * from "./putApiRoomUpdate";
|
|
||||||
export * from "./getApiRoomView";
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user