This commit is contained in:
oneao committed 2026-01-15 17:27:33 +08:00
1 parent b38583a9fe
commit 5bf69e977b
12 files changed
+424 -152

No files matched your search

@@ -7,6 +7,7 @@ import (
"allapp/db" "allapp/db"
"allapp/db/repo" "allapp/db/repo"
"allapp/utils/errorx" "allapp/utils/errorx"
"allapp/utils/idgen"
"allapp/utils/response" "allapp/utils/response"
"context" "context"
@@ -16,11 +17,11 @@ import (
"github.com/cloudwego/hertz/pkg/protocol/consts" "github.com/cloudwego/hertz/pkg/protocol/consts"
) )
// QueryUserMoneyCategory . // List .
// @router /money/category [GET] // @router /money/category [GET]
func QueryUserMoneyCategory(ctx context.Context, c *app.RequestContext) { func List(ctx context.Context, c *app.RequestContext) {
var err error var err error
var req money.QueryMoneyCategoryReq var req money.ListMoneyCategoryReq
err = c.BindAndValidate(&req) err = c.BindAndValidate(&req)
if err != nil { if err != nil {
c.String(consts.StatusBadRequest, err.Error()) c.String(consts.StatusBadRequest, err.Error())
@@ -37,7 +38,7 @@ func QueryUserMoneyCategory(ctx context.Context, c *app.RequestContext) {
} }
// 构造返回数据,切片类型是 []*UserMoneyCategory // 构造返回数据,切片类型是 []*UserMoneyCategory
resp := &money.QueryMoneyCategoryResp{ resp := &money.ListMoneyCategoryResp{
Categories: make([]*money.MoneyCategory, 0, len(moneyUserCategories)), Categories: make([]*money.MoneyCategory, 0, len(moneyUserCategories)),
} }
@@ -116,3 +117,48 @@ func UpdateMoneyCategorySort(ctx context.Context, c *app.RequestContext) {
// 返回成功 // 返回成功
response.Success(c).Send() response.Success(c).Send()
} }
// CreateMoneyCategory .
// @router /money/category/create [POST]
func CreateMoneyCategory(ctx context.Context, c *app.RequestContext) {
var err error
var req money.CreateMoneyCategoryReq
err = c.BindAndValidate(&req)
if err != nil {
c.String(consts.StatusBadRequest, err.Error())
return
}
resp := new(money.CreateMoneyCategoryResp)
ID := idgen.NextId()
params := repo.InsertMoneyUserCategoryParams{
ID: ID,
UserID: middleware.GetUserID(ctx),
Name: req.Name,
Icon: req.Icon,
Type: req.Type,
// 默认排序号为ID
SortNumber: 0,
}
// 插入
db.WithTx(ctx, func(q *repo.Queries) error {
err = q.InsertMoneyUserCategory(ctx, params)
if err != nil {
return err
}
return nil
})
if err != nil {
errorx.AddError(c, err)
return
}
resp.Id = ID
response.Success(c).Data(resp).Send()
}
@@ -3,7 +3,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.28.0 // protoc-gen-go v1.28.0
// protoc v6.33.1 // protoc v4.25.3
// source: api.proto // source: api.proto
package api package api
@@ -583,9 +583,8 @@ var file_api_proto_rawDesc = []byte{
0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x18, 0x8e, 0x8d, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x73, 0x65, 0x72, 0x73, 0x18, 0x8e, 0x8d, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x73, 0x65, 0x72,
0x76, 0x65, 0x42, 0x20, 0x5a, 0x1e, 0x63, 0x6e, 0x2f, 0x6f, 0x6e, 0x65, 0x61, 0x6f, 0x2f, 0x62, 0x76, 0x65, 0x42, 0x16, 0x5a, 0x14, 0x61, 0x6c, 0x6c, 0x61, 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a,
0x61, 0x73, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x61, 0x70, 0x69,
} }
var file_api_proto_goTypes = []interface{}{ var file_api_proto_goTypes = []interface{}{
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.28.0 // protoc-gen-go v1.28.0
// protoc v6.33.1 // protoc v4.25.3
// source: money.proto // source: money.proto
package money package money
@@ -29,97 +29,106 @@ var file_money_proto_rawDesc = []byte{
0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x1e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x5f, 0x72, 0x6f, 0x1a, 0x1e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x5f, 0x72,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x32, 0xfb, 0x02, 0x0a, 0x14, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x32, 0xd9, 0x03, 0x0a, 0x14, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67,
0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6a, 0x0a, 0x16, 0x51, 0x75, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x56, 0x0a, 0x04, 0x4c, 0x69,
0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d,
0x67, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a,
0x72, 0x79, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x1c, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x6e, 0x65,
0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x13, 0xca,
0xc1, 0x18, 0x0f, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f,
0x72, 0x79, 0x12, 0x74, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,
0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e,
0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65,
0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6d,
0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79,
0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1a, 0xd2, 0xc1,
0x18, 0x16, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72,
0x79, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79,
0x53, 0x6f, 0x72, 0x74, 0x12, 0x21, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79,
0x53, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67,
0x6f, 0x72, 0x79, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1e, 0xd2, 0xc1, 0x18,
0x1a, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79,
0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x70, 0x0a, 0x13, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f,
0x72, 0x79, 0x12, 0x1d, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65,
0x71, 0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73,
0x70, 0x22, 0x13, 0xca, 0xc1, 0x18, 0x0f, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x63, 0x61, 0x70, 0x22, 0x1a, 0xd2, 0xc1, 0x18, 0x16, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x63, 0x61,
0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x74, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x32, 0xce, 0x03,
0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x0a, 0x12, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x72,
0x79, 0x12, 0x1d, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x6e,
0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71,
0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d,
0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70,
0x22, 0x1a, 0xd2, 0xc1, 0x18, 0x16, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x63, 0x61, 0x74,
0x65, 0x67, 0x6f, 0x72, 0x79, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x80, 0x01, 0x0a,
0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65,
0x67, 0x6f, 0x72, 0x79, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x21, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79,
0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65,
0x67, 0x6f, 0x72, 0x79, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6d, 0x6f,
0x6e, 0x65, 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43,
0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22,
0x1e, 0xd2, 0xc1, 0x18, 0x1a, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x63, 0x61, 0x74, 0x65,
0x67, 0x6f, 0x72, 0x79, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6f, 0x72, 0x74, 0x32,
0xce, 0x03, 0x0a, 0x12, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d,
0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e,
0x65, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63,
0x6f, 0x72, 0x64, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e,
0x65, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63,
0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x17, 0xd2, 0xc1, 0x18, 0x13,
0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2f, 0x71, 0x75,
0x65, 0x72, 0x79, 0x12, 0x6d, 0x0a, 0x11, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x6f, 0x6e,
0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79,
0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72,
0x72, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x64, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79,
0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72,
0x72, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x18, 0xd2, 0xc1, 0x18, 0x14, 0x2f, 0x6d, 0x64, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x17, 0xd2, 0xc1, 0x18, 0x13, 0x2f, 0x6d,
0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2f, 0x69, 0x6e, 0x73, 0x65, 0x6f, 0x6e, 0x65, 0x79, 0x2f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2f, 0x71, 0x75, 0x65, 0x72,
0x72, 0x74, 0x12, 0x6d, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x6d, 0x0a, 0x11, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x6f, 0x6e, 0x65, 0x79,
0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x49,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x49,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x18, 0xd2, 0xc1, 0x18, 0x14, 0x2f, 0x6d, 0x6f,
0x6e, 0x65, 0x79, 0x2f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74,
0x65, 0x12, 0x6d, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79,
0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x18, 0xd2, 0xc1, 0x18, 0x14, 0x2f, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x18, 0xd2, 0xc1, 0x18, 0x14, 0x2f, 0x6d, 0x6f, 0x6e,
0x65, 0x79, 0x2f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x65, 0x79, 0x2f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2f, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74,
0x42, 0x22, 0x5a, 0x20, 0x63, 0x6e, 0x2f, 0x6f, 0x6e, 0x65, 0x61, 0x6f, 0x2f, 0x62, 0x61, 0x73, 0x12, 0x6d, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52,
0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x55, 0x70,
0x6f, 0x6e, 0x65, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50,
0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x18, 0xd2, 0xc1, 0x18, 0x14, 0x2f, 0x6d, 0x6f, 0x6e, 0x65,
0x79, 0x2f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12,
0x6d, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50, 0x61,
0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x22, 0x18, 0xd2, 0xc1, 0x18, 0x14, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79,
0x2f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x18,
0x5a, 0x16, 0x61, 0x6c, 0x6c, 0x61, 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f, 0x64,
0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var file_money_proto_goTypes = []interface{}{ var file_money_proto_goTypes = []interface{}{
(*QueryMoneyCategoryReq)(nil), // 0: money.QueryMoneyCategoryReq (*ListMoneyCategoryReq)(nil), // 0: money.ListMoneyCategoryReq
(*DeleteMoneyCategoryReq)(nil), // 1: money.DeleteMoneyCategoryReq (*DeleteMoneyCategoryReq)(nil), // 1: money.DeleteMoneyCategoryReq
(*UpdateMoneyCategorySortReq)(nil), // 2: money.UpdateMoneyCategorySortReq (*UpdateMoneyCategorySortReq)(nil), // 2: money.UpdateMoneyCategorySortReq
(*QueryMoneyRecordsParams)(nil), // 3: money.QueryMoneyRecordsParams (*CreateMoneyCategoryReq)(nil), // 3: money.CreateMoneyCategoryReq
(*InsertMoneyRecordParams)(nil), // 4: money.InsertMoneyRecordParams (*QueryMoneyRecordsParams)(nil), // 4: money.QueryMoneyRecordsParams
(*UpdateMoneyRecordParams)(nil), // 5: money.UpdateMoneyRecordParams (*InsertMoneyRecordParams)(nil), // 5: money.InsertMoneyRecordParams
(*DeleteMoneyRecordParams)(nil), // 6: money.DeleteMoneyRecordParams (*UpdateMoneyRecordParams)(nil), // 6: money.UpdateMoneyRecordParams
(*QueryMoneyCategoryResp)(nil), // 7: money.QueryMoneyCategoryResp (*DeleteMoneyRecordParams)(nil), // 7: money.DeleteMoneyRecordParams
(*DeleteMoneyCategoryResp)(nil), // 8: money.DeleteMoneyCategoryResp (*ListMoneyCategoryResp)(nil), // 8: money.ListMoneyCategoryResp
(*UpdateMoneyCategorySortResp)(nil), // 9: money.UpdateMoneyCategorySortResp (*DeleteMoneyCategoryResp)(nil), // 9: money.DeleteMoneyCategoryResp
(*QueryMoneyRecordsResult)(nil), // 10: money.QueryMoneyRecordsResult (*UpdateMoneyCategorySortResp)(nil), // 10: money.UpdateMoneyCategorySortResp
(*InsertMoneyRecordResult)(nil), // 11: money.InsertMoneyRecordResult (*CreateMoneyCategoryResp)(nil), // 11: money.CreateMoneyCategoryResp
(*UpdateMoneyRecordResult)(nil), // 12: money.UpdateMoneyRecordResult (*QueryMoneyRecordsResult)(nil), // 12: money.QueryMoneyRecordsResult
(*DeleteMoneyRecordResult)(nil), // 13: money.DeleteMoneyRecordResult (*InsertMoneyRecordResult)(nil), // 13: money.InsertMoneyRecordResult
(*UpdateMoneyRecordResult)(nil), // 14: money.UpdateMoneyRecordResult
(*DeleteMoneyRecordResult)(nil), // 15: money.DeleteMoneyRecordResult
} }
var file_money_proto_depIdxs = []int32{ var file_money_proto_depIdxs = []int32{
0, // 0: money.MoneyCategoryService.QueryUserMoneyCategory:input_type -> money.QueryMoneyCategoryReq 0, // 0: money.MoneyCategoryService.List:input_type -> money.ListMoneyCategoryReq
1, // 1: money.MoneyCategoryService.DeleteUserMoneyCategory:input_type -> money.DeleteMoneyCategoryReq 1, // 1: money.MoneyCategoryService.DeleteUserMoneyCategory:input_type -> money.DeleteMoneyCategoryReq
2, // 2: money.MoneyCategoryService.UpdateMoneyCategorySort:input_type -> money.UpdateMoneyCategorySortReq 2, // 2: money.MoneyCategoryService.UpdateMoneyCategorySort:input_type -> money.UpdateMoneyCategorySortReq
3, // 3: money.MoneyRecordService.QueryMoneyRecord:input_type -> money.QueryMoneyRecordsParams 3, // 3: money.MoneyCategoryService.CreateMoneyCategory:input_type -> money.CreateMoneyCategoryReq
4, // 4: money.MoneyRecordService.InsertMoneyRecord:input_type -> money.InsertMoneyRecordParams 4, // 4: money.MoneyRecordService.QueryMoneyRecord:input_type -> money.QueryMoneyRecordsParams
5, // 5: money.MoneyRecordService.UpdateMoneyRecord:input_type -> money.UpdateMoneyRecordParams 5, // 5: money.MoneyRecordService.InsertMoneyRecord:input_type -> money.InsertMoneyRecordParams
6, // 6: money.MoneyRecordService.DeleteMoneyRecord:input_type -> money.DeleteMoneyRecordParams 6, // 6: money.MoneyRecordService.UpdateMoneyRecord:input_type -> money.UpdateMoneyRecordParams
7, // 7: money.MoneyCategoryService.QueryUserMoneyCategory:output_type -> money.QueryMoneyCategoryResp 7, // 7: money.MoneyRecordService.DeleteMoneyRecord:input_type -> money.DeleteMoneyRecordParams
8, // 8: money.MoneyCategoryService.DeleteUserMoneyCategory:output_type -> money.DeleteMoneyCategoryResp 8, // 8: money.MoneyCategoryService.List:output_type -> money.ListMoneyCategoryResp
9, // 9: money.MoneyCategoryService.UpdateMoneyCategorySort:output_type -> money.UpdateMoneyCategorySortResp 9, // 9: money.MoneyCategoryService.DeleteUserMoneyCategory:output_type -> money.DeleteMoneyCategoryResp
10, // 10: money.MoneyRecordService.QueryMoneyRecord:output_type -> money.QueryMoneyRecordsResult 10, // 10: money.MoneyCategoryService.UpdateMoneyCategorySort:output_type -> money.UpdateMoneyCategorySortResp
11, // 11: money.MoneyRecordService.InsertMoneyRecord:output_type -> money.InsertMoneyRecordResult 11, // 11: money.MoneyCategoryService.CreateMoneyCategory:output_type -> money.CreateMoneyCategoryResp
12, // 12: money.MoneyRecordService.UpdateMoneyRecord:output_type -> money.UpdateMoneyRecordResult 12, // 12: money.MoneyRecordService.QueryMoneyRecord:output_type -> money.QueryMoneyRecordsResult
13, // 13: money.MoneyRecordService.DeleteMoneyRecord:output_type -> money.DeleteMoneyRecordResult 13, // 13: money.MoneyRecordService.InsertMoneyRecord:output_type -> money.InsertMoneyRecordResult
7, // [7:14] is the sub-list for method output_type 14, // 14: money.MoneyRecordService.UpdateMoneyRecord:output_type -> money.UpdateMoneyRecordResult
0, // [0:7] is the sub-list for method input_type 15, // 15: money.MoneyRecordService.DeleteMoneyRecord:output_type -> money.DeleteMoneyRecordResult
8, // [8:16] is the sub-list for method output_type
0, // [0:8] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name 0, // [0:0] is the sub-list for field type_name
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.28.0 // protoc-gen-go v1.28.0
// protoc v6.33.1 // protoc v4.25.3
// source: money/money_category_types.proto // source: money/money_category_types.proto
package money package money
@@ -102,14 +102,14 @@ func (x *MoneyCategory) GetSortNumber() int32 {
} }
// 查询记账分类请求 // 查询记账分类请求
type QueryMoneyCategoryReq struct { type ListMoneyCategoryReq struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
} }
func (x *QueryMoneyCategoryReq) Reset() { func (x *ListMoneyCategoryReq) Reset() {
*x = QueryMoneyCategoryReq{} *x = ListMoneyCategoryReq{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_money_money_category_types_proto_msgTypes[1] mi := &file_money_money_category_types_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -117,13 +117,13 @@ func (x *QueryMoneyCategoryReq) Reset() {
} }
} }
func (x *QueryMoneyCategoryReq) String() string { func (x *ListMoneyCategoryReq) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*QueryMoneyCategoryReq) ProtoMessage() {} func (*ListMoneyCategoryReq) ProtoMessage() {}
func (x *QueryMoneyCategoryReq) ProtoReflect() protoreflect.Message { func (x *ListMoneyCategoryReq) ProtoReflect() protoreflect.Message {
mi := &file_money_money_category_types_proto_msgTypes[1] mi := &file_money_money_category_types_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -135,13 +135,13 @@ func (x *QueryMoneyCategoryReq) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use QueryMoneyCategoryReq.ProtoReflect.Descriptor instead. // Deprecated: Use ListMoneyCategoryReq.ProtoReflect.Descriptor instead.
func (*QueryMoneyCategoryReq) Descriptor() ([]byte, []int) { func (*ListMoneyCategoryReq) Descriptor() ([]byte, []int) {
return file_money_money_category_types_proto_rawDescGZIP(), []int{1} return file_money_money_category_types_proto_rawDescGZIP(), []int{1}
} }
// 查询记账分类响应 // 查询记账分类响应
type QueryMoneyCategoryResp struct { type ListMoneyCategoryResp struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
@@ -149,8 +149,8 @@ type QueryMoneyCategoryResp struct {
Categories []*MoneyCategory `protobuf:"bytes,1,rep,name=Categories,proto3" form:"categories" json:"categories"` Categories []*MoneyCategory `protobuf:"bytes,1,rep,name=Categories,proto3" form:"categories" json:"categories"`
} }
func (x *QueryMoneyCategoryResp) Reset() { func (x *ListMoneyCategoryResp) Reset() {
*x = QueryMoneyCategoryResp{} *x = ListMoneyCategoryResp{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_money_money_category_types_proto_msgTypes[2] mi := &file_money_money_category_types_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -158,13 +158,13 @@ func (x *QueryMoneyCategoryResp) Reset() {
} }
} }
func (x *QueryMoneyCategoryResp) String() string { func (x *ListMoneyCategoryResp) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*QueryMoneyCategoryResp) ProtoMessage() {} func (*ListMoneyCategoryResp) ProtoMessage() {}
func (x *QueryMoneyCategoryResp) ProtoReflect() protoreflect.Message { func (x *ListMoneyCategoryResp) ProtoReflect() protoreflect.Message {
mi := &file_money_money_category_types_proto_msgTypes[2] mi := &file_money_money_category_types_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -176,12 +176,12 @@ func (x *QueryMoneyCategoryResp) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use QueryMoneyCategoryResp.ProtoReflect.Descriptor instead. // Deprecated: Use ListMoneyCategoryResp.ProtoReflect.Descriptor instead.
func (*QueryMoneyCategoryResp) Descriptor() ([]byte, []int) { func (*ListMoneyCategoryResp) Descriptor() ([]byte, []int) {
return file_money_money_category_types_proto_rawDescGZIP(), []int{2} return file_money_money_category_types_proto_rawDescGZIP(), []int{2}
} }
func (x *QueryMoneyCategoryResp) GetCategories() []*MoneyCategory { func (x *ListMoneyCategoryResp) GetCategories() []*MoneyCategory {
if x != nil { if x != nil {
return x.Categories return x.Categories
} }
@@ -418,6 +418,116 @@ func (*UpdateMoneyCategorySortResp) Descriptor() ([]byte, []int) {
return file_money_money_category_types_proto_rawDescGZIP(), []int{7} return file_money_money_category_types_proto_rawDescGZIP(), []int{7}
} }
type CreateMoneyCategoryReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=Name,proto3" form:"name" json:"name" vd:"$ != '' && len($) <= 5"`
Icon string `protobuf:"bytes,2,opt,name=Icon,proto3" form:"icon" json:"icon" vd:"$ != ''"`
Type int32 `protobuf:"varint,3,opt,name=Type,proto3" form:"type" json:"type"`
}
func (x *CreateMoneyCategoryReq) Reset() {
*x = CreateMoneyCategoryReq{}
if protoimpl.UnsafeEnabled {
mi := &file_money_money_category_types_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateMoneyCategoryReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateMoneyCategoryReq) ProtoMessage() {}
func (x *CreateMoneyCategoryReq) ProtoReflect() protoreflect.Message {
mi := &file_money_money_category_types_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateMoneyCategoryReq.ProtoReflect.Descriptor instead.
func (*CreateMoneyCategoryReq) Descriptor() ([]byte, []int) {
return file_money_money_category_types_proto_rawDescGZIP(), []int{8}
}
func (x *CreateMoneyCategoryReq) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *CreateMoneyCategoryReq) GetIcon() string {
if x != nil {
return x.Icon
}
return ""
}
func (x *CreateMoneyCategoryReq) GetType() int32 {
if x != nil {
return x.Type
}
return 0
}
type CreateMoneyCategoryResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=Id,proto3" form:"id" json:"id"`
}
func (x *CreateMoneyCategoryResp) Reset() {
*x = CreateMoneyCategoryResp{}
if protoimpl.UnsafeEnabled {
mi := &file_money_money_category_types_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateMoneyCategoryResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateMoneyCategoryResp) ProtoMessage() {}
func (x *CreateMoneyCategoryResp) ProtoReflect() protoreflect.Message {
mi := &file_money_money_category_types_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateMoneyCategoryResp.ProtoReflect.Descriptor instead.
func (*CreateMoneyCategoryResp) Descriptor() ([]byte, []int) {
return file_money_money_category_types_proto_rawDescGZIP(), []int{9}
}
func (x *CreateMoneyCategoryResp) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
var File_money_money_category_types_proto protoreflect.FileDescriptor var File_money_money_category_types_proto protoreflect.FileDescriptor
var file_money_money_category_types_proto_rawDesc = []byte{ var file_money_money_category_types_proto_rawDesc = []byte{
@@ -435,36 +545,49 @@ var file_money_money_category_types_proto_rawDesc = []byte{
0x70, 0x65, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x53, 0x6f, 0x72, 0x74, 0x70, 0x65, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x53, 0x6f, 0x72, 0x74,
0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0f, 0xca, 0xbb, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0f, 0xca, 0xbb,
0x18, 0x0b, 0x73, 0x6f, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0a, 0x53, 0x18, 0x0b, 0x73, 0x6f, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0a, 0x53,
0x6f, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x17, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x6f, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x16, 0x0a, 0x14, 0x4c, 0x69, 0x73,
0x72, 0x79, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x74, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65,
0x65, 0x71, 0x22, 0x5e, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x71, 0x22, 0x5d, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61,
0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, 0x0a, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, 0x0a, 0x43, 0x61,
0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14,
0x32, 0x14, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65,
0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x42, 0x0e, 0xca, 0xbb, 0x18, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x42, 0x0e, 0xca, 0xbb, 0x18, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f,
0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x72, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73,
0x65, 0x73, 0x22, 0x3a, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x22, 0x3a, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43,
0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x02, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x02, 0x49, 0x64,
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x10, 0xca, 0xbb, 0x18, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x10, 0xca, 0xbb, 0x18, 0x02, 0x69, 0x64, 0xda, 0xbb,
0xda, 0xbb, 0x18, 0x06, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x52, 0x02, 0x49, 0x64, 0x22, 0x19, 0x18, 0x06, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x52, 0x02, 0x49, 0x64, 0x22, 0x19, 0x0a, 0x17,
0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67,
0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x60, 0x0a, 0x15, 0x4d, 0x6f, 0x6e, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x60, 0x0a, 0x15, 0x4d, 0x6f, 0x6e, 0x65, 0x79,
0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x53, 0x6f, 0x72, 0x74, 0x49, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x53, 0x6f, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d,
0x65, 0x6d, 0x12, 0x16, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x06, 0x12, 0x16, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x06, 0xca, 0xbb,
0xca, 0xbb, 0x18, 0x02, 0x69, 0x64, 0x52, 0x02, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x0a, 0x53, 0x6f, 0x18, 0x02, 0x69, 0x64, 0x52, 0x02, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x0a, 0x53, 0x6f, 0x72, 0x74,
0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0f, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0f, 0xca, 0xbb,
0xca, 0xbb, 0x18, 0x0b, 0x73, 0x6f, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x18, 0x0b, 0x73, 0x6f, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0a, 0x53,
0x0a, 0x53, 0x6f, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x58, 0x0a, 0x1a, 0x55, 0x6f, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x58, 0x0a, 0x1a, 0x55, 0x70, 0x64,
0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79,
0x72, 0x79, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x3a, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x3a, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18,
0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x2e, 0x4d, 0x6f,
0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x53, 0x6f, 0x72, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x53, 0x6f, 0x72, 0x74, 0x49,
0x74, 0x49, 0x74, 0x65, 0x6d, 0x42, 0x08, 0xca, 0xbb, 0x18, 0x04, 0x64, 0x61, 0x74, 0x61, 0x52, 0x74, 0x65, 0x6d, 0x42, 0x08, 0xca, 0xbb, 0x18, 0x04, 0x64, 0x61, 0x74, 0x61, 0x52, 0x04, 0x44,
0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x1d, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x74, 0x61, 0x22, 0x1d, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e,
0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x53, 0x6f, 0x72, 0x74, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x65,
0x52, 0x65, 0x73, 0x70, 0x42, 0x22, 0x5a, 0x20, 0x63, 0x6e, 0x2f, 0x6f, 0x6e, 0x65, 0x61, 0x6f, 0x73, 0x70, 0x22, 0x97, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e,
0x2f, 0x62, 0x61, 0x73, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x36, 0x0a,
0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xca, 0xbb, 0x18,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0xda, 0xbb, 0x18, 0x16, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x27, 0x27,
0x20, 0x26, 0x26, 0x20, 0x6c, 0x65, 0x6e, 0x28, 0x24, 0x29, 0x20, 0x3c, 0x3d, 0x20, 0x35, 0x52,
0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x49, 0x63, 0x6f, 0x6e, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x13, 0xca, 0xbb, 0x18, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0xda, 0xbb, 0x18,
0x07, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x27, 0x27, 0x52, 0x04, 0x49, 0x63, 0x6f, 0x6e, 0x12, 0x1c,
0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x08, 0xca, 0xbb,
0x18, 0x04, 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x22, 0x31, 0x0a, 0x17,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67,
0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x42, 0x06, 0xca, 0xbb, 0x18, 0x02, 0x69, 0x64, 0x52, 0x02, 0x49, 0x64, 0x42,
0x18, 0x5a, 0x16, 0x61, 0x6c, 0x6c, 0x61, 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f,
0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
} }
var ( var (
@@ -479,19 +602,21 @@ func file_money_money_category_types_proto_rawDescGZIP() []byte {
return file_money_money_category_types_proto_rawDescData return file_money_money_category_types_proto_rawDescData
} }
var file_money_money_category_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_money_money_category_types_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_money_money_category_types_proto_goTypes = []interface{}{ var file_money_money_category_types_proto_goTypes = []interface{}{
(*MoneyCategory)(nil), // 0: money.MoneyCategory (*MoneyCategory)(nil), // 0: money.MoneyCategory
(*QueryMoneyCategoryReq)(nil), // 1: money.QueryMoneyCategoryReq (*ListMoneyCategoryReq)(nil), // 1: money.ListMoneyCategoryReq
(*QueryMoneyCategoryResp)(nil), // 2: money.QueryMoneyCategoryResp (*ListMoneyCategoryResp)(nil), // 2: money.ListMoneyCategoryResp
(*DeleteMoneyCategoryReq)(nil), // 3: money.DeleteMoneyCategoryReq (*DeleteMoneyCategoryReq)(nil), // 3: money.DeleteMoneyCategoryReq
(*DeleteMoneyCategoryResp)(nil), // 4: money.DeleteMoneyCategoryResp (*DeleteMoneyCategoryResp)(nil), // 4: money.DeleteMoneyCategoryResp
(*MoneyCategorySortItem)(nil), // 5: money.MoneyCategorySortItem (*MoneyCategorySortItem)(nil), // 5: money.MoneyCategorySortItem
(*UpdateMoneyCategorySortReq)(nil), // 6: money.UpdateMoneyCategorySortReq (*UpdateMoneyCategorySortReq)(nil), // 6: money.UpdateMoneyCategorySortReq
(*UpdateMoneyCategorySortResp)(nil), // 7: money.UpdateMoneyCategorySortResp (*UpdateMoneyCategorySortResp)(nil), // 7: money.UpdateMoneyCategorySortResp
(*CreateMoneyCategoryReq)(nil), // 8: money.CreateMoneyCategoryReq
(*CreateMoneyCategoryResp)(nil), // 9: money.CreateMoneyCategoryResp
} }
var file_money_money_category_types_proto_depIdxs = []int32{ var file_money_money_category_types_proto_depIdxs = []int32{
0, // 0: money.QueryMoneyCategoryResp.Categories:type_name -> money.MoneyCategory 0, // 0: money.ListMoneyCategoryResp.Categories:type_name -> money.MoneyCategory
5, // 1: money.UpdateMoneyCategorySortReq.Data:type_name -> money.MoneyCategorySortItem 5, // 1: money.UpdateMoneyCategorySortReq.Data:type_name -> money.MoneyCategorySortItem
2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for method input_type
@@ -519,7 +644,7 @@ func file_money_money_category_types_proto_init() {
} }
} }
file_money_money_category_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_money_money_category_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QueryMoneyCategoryReq); i { switch v := v.(*ListMoneyCategoryReq); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@@ -531,7 +656,7 @@ func file_money_money_category_types_proto_init() {
} }
} }
file_money_money_category_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_money_money_category_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QueryMoneyCategoryResp); i { switch v := v.(*ListMoneyCategoryResp); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@@ -602,6 +727,30 @@ func file_money_money_category_types_proto_init() {
return nil return nil
} }
} }
file_money_money_category_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateMoneyCategoryReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_money_money_category_types_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateMoneyCategoryResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@@ -609,7 +758,7 @@ func file_money_money_category_types_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_money_money_category_types_proto_rawDesc, RawDescriptor: file_money_money_category_types_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 8, NumMessages: 10,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.28.0 // protoc-gen-go v1.28.0
// protoc v6.33.1 // protoc v4.25.3
// source: money/money_record_types.proto // source: money/money_record_types.proto
package money package money
@@ -865,10 +865,9 @@ var file_money_money_record_types_proto_rawDesc = []byte{
0x12, 0x1e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0e, 0xca, 0xbb, 0x12, 0x1e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0e, 0xca, 0xbb,
0x18, 0x02, 0x69, 0x64, 0xda, 0xbb, 0x18, 0x04, 0x24, 0x21, 0x3d, 0x30, 0x52, 0x02, 0x49, 0x64, 0x18, 0x02, 0x69, 0x64, 0xda, 0xbb, 0x18, 0x04, 0x24, 0x21, 0x3d, 0x30, 0x52, 0x02, 0x49, 0x64,
0x22, 0x19, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x22, 0x19, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x22, 0x5a, 0x20, 0x63, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x18, 0x5a, 0x16, 0x61,
0x6e, 0x2f, 0x6f, 0x6e, 0x65, 0x61, 0x6f, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x6c, 0x6c, 0x61, 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f,
0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x62, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@@ -60,3 +60,13 @@ func _deletemoneyrecordMw() []app.HandlerFunc {
// your code... // your code...
return nil return nil
} }
func _createmoneycategoryMw() []app.HandlerFunc {
// your code...
return nil
}
func _listMw() []app.HandlerFunc {
// your code...
return nil
}
@@ -19,8 +19,9 @@ func Register(r *server.Hertz) {
root := r.Group("/", rootMw()...) root := r.Group("/", rootMw()...)
{ {
_money := root.Group("/money", _moneyMw()...) _money := root.Group("/money", _moneyMw()...)
_money.GET("/category", append(_queryusermoneycategoryMw(), money.QueryUserMoneyCategory)...) _money.GET("/category", append(_listMw(), money.List)...)
_category := _money.Group("/category", _categoryMw()...) _category := _money.Group("/category", _categoryMw()...)
_category.POST("/create", append(_createmoneycategoryMw(), money.CreateMoneyCategory)...)
_category.POST("/delete", append(_deleteusermoneycategoryMw(), money.DeleteUserMoneyCategory)...) _category.POST("/delete", append(_deleteusermoneycategoryMw(), money.DeleteUserMoneyCategory)...)
_category.POST("/updateSort", append(_updatemoneycategorysortMw(), money.UpdateMoneyCategorySort)...) _category.POST("/updateSort", append(_updatemoneycategorysortMw(), money.UpdateMoneyCategorySort)...)
{ {
@@ -19,3 +19,7 @@ WHERE id = $1;
-- name: DeleteMoneyCategoryByUserId :exec -- name: DeleteMoneyCategoryByUserId :exec
DELETE FROM money_user_category DELETE FROM money_user_category
WHERE user_id = $1; WHERE user_id = $1;
-- name: InsertMoneyUserCategory :exec
INSERT INTO money_user_category (id, user_id, name, icon, type, sort_number)
VALUES ($1, $2, $3, $4, $5, $6);
@@ -71,3 +71,29 @@ func (q *Queries) FindUserMoneyCategoriesByUserID(ctx context.Context, userID in
} }
return items, nil return items, nil
} }
const insertMoneyUserCategory = `-- name: InsertMoneyUserCategory :exec
INSERT INTO money_user_category (id, user_id, name, icon, type, sort_number)
VALUES ($1, $2, $3, $4, $5, $6)
`
type InsertMoneyUserCategoryParams struct {
ID int64
UserID int64
Name string
Icon string
Type int32
SortNumber int32
}
func (q *Queries) InsertMoneyUserCategory(ctx context.Context, arg InsertMoneyUserCategoryParams) error {
_, err := q.db.Exec(ctx, insertMoneyUserCategory,
arg.ID,
arg.UserID,
arg.Name,
arg.Icon,
arg.Type,
arg.SortNumber,
)
return err
}
+4 -1
View File
@@ -9,7 +9,7 @@ import "money/money_category_types.proto";
import "money/money_record_types.proto"; import "money/money_record_types.proto";
service MoneyCategoryService { service MoneyCategoryService {
rpc QueryUserMoneyCategory(QueryMoneyCategoryReq) returns (QueryMoneyCategoryResp){ rpc List(ListMoneyCategoryReq) returns (ListMoneyCategoryResp){
option (api.get) = '/money/category'; option (api.get) = '/money/category';
}; };
rpc DeleteUserMoneyCategory(DeleteMoneyCategoryReq) returns (DeleteMoneyCategoryResp){ rpc DeleteUserMoneyCategory(DeleteMoneyCategoryReq) returns (DeleteMoneyCategoryResp){
@@ -18,6 +18,9 @@ service MoneyCategoryService {
rpc UpdateMoneyCategorySort(UpdateMoneyCategorySortReq) returns (UpdateMoneyCategorySortResp){ rpc UpdateMoneyCategorySort(UpdateMoneyCategorySortReq) returns (UpdateMoneyCategorySortResp){
option (api.post) = '/money/category/updateSort'; option (api.post) = '/money/category/updateSort';
}; };
rpc CreateMoneyCategory(CreateMoneyCategoryReq) returns (CreateMoneyCategoryResp){
option (api.post) = '/money/category/create';
};
} }
service MoneyRecordService { service MoneyRecordService {
@@ -15,10 +15,10 @@ message MoneyCategory {
} }
// 查询记账分类请求 // 查询记账分类请求
message QueryMoneyCategoryReq {} message ListMoneyCategoryReq {}
// 查询记账分类响应 // 查询记账分类响应
message QueryMoneyCategoryResp { message ListMoneyCategoryResp {
repeated MoneyCategory Categories = 1 [(api.body)="categories"]; repeated MoneyCategory Categories = 1 [(api.body)="categories"];
} }
@@ -43,3 +43,19 @@ message UpdateMoneyCategorySortReq {
// 修改分类排序响应 // 修改分类排序响应
message UpdateMoneyCategorySortResp {} message UpdateMoneyCategorySortResp {}
message CreateMoneyCategoryReq {
string Name = 1 [
(api.body)="name",
(api.vd) = "$ != '' && len($) <= 5"
];
string Icon = 2 [
(api.body)="icon",
(api.vd) = "$ != ''"
];
int32 Type = 3 [(api.body)="type"];
}
message CreateMoneyCategoryResp {
int64 Id = 1 [(api.body)="id"];
}
@@ -33,3 +33,13 @@ export enum MoneyCategoryEnum {
Expense = 0, // 支出 Expense = 0, // 支出
Income = 1, // 收入 Income = 1, // 收入
} }
export interface CreateMoneyCategoryParams {
name: string
icon: string
type: MoneyCategoryEnum
}
export interface CreateMoneyCategoryResult {
id: number
}