Browse Source

fix:save 19

jimmyyem 4 months ago
parent
commit
3041361a83

+ 1 - 1
desc/wechat/aliyun_avatar.api

@@ -21,7 +21,7 @@ type (
         AppId  *string `json:"appId,optional"`
 
         // tenant_id | TenantId 
-        TenantD  *uint64 `json:"tenantD,optional"`
+		TenantId  *uint64 `json:"TenantId,optional"`
 
         // response | 阿里云avatar响应 
         Response  *string `json:"response,optional"`

+ 15 - 0
desc/wechat/chat_records.api

@@ -74,6 +74,17 @@ type (
 		Data []string `json:"data"`
 		SessionId uint64 `json:"sessionId"`
 	}
+
+	ChatAskReq {
+		CardId *uint64 `json:"cardId"`
+		Question *string `json:"question"`
+		SessionId *int `json:"sessionId"`
+	}
+
+	ChatAskResp {
+		BaseDataInfo
+		Data *string `json:"data"`
+	}
 )
 
 @server(
@@ -87,6 +98,10 @@ service Wechat {
 	@handler submitApiChat
 	post /api/chat/create (ChatRecordsInfo)
 
+	// Create chat records information | 创建ChatRecords
+	@handler answerApiChat
+	post /api/chat/answer (ChatAskReq) returns (ChatAskResp)
+
 	// Get chat records list | 获取ChatRecords列表
 	@handler getApiChatList
 	post /api/chat/list (ChatRecordsListReq) returns (ChatRecordsListResp)

+ 2 - 2
ent/aliyunavatar.go

@@ -34,7 +34,7 @@ type AliyunAvatar struct {
 	// app_id | AppId
 	AppID string `json:"app_id,omitempty"`
 	// tenant_id | TenantId
-	TenantID int64 `json:"tenant_id,omitempty"`
+	TenantID uint64 `json:"tenant_id,omitempty"`
 	// response | 阿里云avatar响应
 	Response string `json:"response,omitempty"`
 	// token | Token
@@ -128,7 +128,7 @@ func (aa *AliyunAvatar) assignValues(columns []string, values []any) error {
 			if value, ok := values[i].(*sql.NullInt64); !ok {
 				return fmt.Errorf("unexpected type %T for field tenant_id", values[i])
 			} else if value.Valid {
-				aa.TenantID = value.Int64
+				aa.TenantID = uint64(value.Int64)
 			}
 		case aliyunavatar.FieldResponse:
 			if value, ok := values[i].(*sql.NullString); !ok {

+ 9 - 9
ent/aliyunavatar/where.go

@@ -95,7 +95,7 @@ func AppID(v string) predicate.AliyunAvatar {
 }
 
 // TenantID applies equality check predicate on the "tenant_id" field. It's identical to TenantIDEQ.
-func TenantID(v int64) predicate.AliyunAvatar {
+func TenantID(v uint64) predicate.AliyunAvatar {
 	return predicate.AliyunAvatar(sql.FieldEQ(FieldTenantID, v))
 }
 
@@ -555,42 +555,42 @@ func AppIDContainsFold(v string) predicate.AliyunAvatar {
 }
 
 // TenantIDEQ applies the EQ predicate on the "tenant_id" field.
-func TenantIDEQ(v int64) predicate.AliyunAvatar {
+func TenantIDEQ(v uint64) predicate.AliyunAvatar {
 	return predicate.AliyunAvatar(sql.FieldEQ(FieldTenantID, v))
 }
 
 // TenantIDNEQ applies the NEQ predicate on the "tenant_id" field.
-func TenantIDNEQ(v int64) predicate.AliyunAvatar {
+func TenantIDNEQ(v uint64) predicate.AliyunAvatar {
 	return predicate.AliyunAvatar(sql.FieldNEQ(FieldTenantID, v))
 }
 
 // TenantIDIn applies the In predicate on the "tenant_id" field.
-func TenantIDIn(vs ...int64) predicate.AliyunAvatar {
+func TenantIDIn(vs ...uint64) predicate.AliyunAvatar {
 	return predicate.AliyunAvatar(sql.FieldIn(FieldTenantID, vs...))
 }
 
 // TenantIDNotIn applies the NotIn predicate on the "tenant_id" field.
-func TenantIDNotIn(vs ...int64) predicate.AliyunAvatar {
+func TenantIDNotIn(vs ...uint64) predicate.AliyunAvatar {
 	return predicate.AliyunAvatar(sql.FieldNotIn(FieldTenantID, vs...))
 }
 
 // TenantIDGT applies the GT predicate on the "tenant_id" field.
-func TenantIDGT(v int64) predicate.AliyunAvatar {
+func TenantIDGT(v uint64) predicate.AliyunAvatar {
 	return predicate.AliyunAvatar(sql.FieldGT(FieldTenantID, v))
 }
 
 // TenantIDGTE applies the GTE predicate on the "tenant_id" field.
-func TenantIDGTE(v int64) predicate.AliyunAvatar {
+func TenantIDGTE(v uint64) predicate.AliyunAvatar {
 	return predicate.AliyunAvatar(sql.FieldGTE(FieldTenantID, v))
 }
 
 // TenantIDLT applies the LT predicate on the "tenant_id" field.
-func TenantIDLT(v int64) predicate.AliyunAvatar {
+func TenantIDLT(v uint64) predicate.AliyunAvatar {
 	return predicate.AliyunAvatar(sql.FieldLT(FieldTenantID, v))
 }
 
 // TenantIDLTE applies the LTE predicate on the "tenant_id" field.
-func TenantIDLTE(v int64) predicate.AliyunAvatar {
+func TenantIDLTE(v uint64) predicate.AliyunAvatar {
 	return predicate.AliyunAvatar(sql.FieldLTE(FieldTenantID, v))
 }
 

+ 9 - 9
ent/aliyunavatar_create.go

@@ -103,8 +103,8 @@ func (aac *AliyunAvatarCreate) SetNillableAppID(s *string) *AliyunAvatarCreate {
 }
 
 // SetTenantID sets the "tenant_id" field.
-func (aac *AliyunAvatarCreate) SetTenantID(i int64) *AliyunAvatarCreate {
-	aac.mutation.SetTenantID(i)
+func (aac *AliyunAvatarCreate) SetTenantID(u uint64) *AliyunAvatarCreate {
+	aac.mutation.SetTenantID(u)
 	return aac
 }
 
@@ -308,7 +308,7 @@ func (aac *AliyunAvatarCreate) createSpec() (*AliyunAvatar, *sqlgraph.CreateSpec
 		_node.AppID = value
 	}
 	if value, ok := aac.mutation.TenantID(); ok {
-		_spec.SetField(aliyunavatar.FieldTenantID, field.TypeInt64, value)
+		_spec.SetField(aliyunavatar.FieldTenantID, field.TypeUint64, value)
 		_node.TenantID = value
 	}
 	if value, ok := aac.mutation.Response(); ok {
@@ -478,7 +478,7 @@ func (u *AliyunAvatarUpsert) ClearAppID() *AliyunAvatarUpsert {
 }
 
 // SetTenantID sets the "tenant_id" field.
-func (u *AliyunAvatarUpsert) SetTenantID(v int64) *AliyunAvatarUpsert {
+func (u *AliyunAvatarUpsert) SetTenantID(v uint64) *AliyunAvatarUpsert {
 	u.Set(aliyunavatar.FieldTenantID, v)
 	return u
 }
@@ -490,7 +490,7 @@ func (u *AliyunAvatarUpsert) UpdateTenantID() *AliyunAvatarUpsert {
 }
 
 // AddTenantID adds v to the "tenant_id" field.
-func (u *AliyunAvatarUpsert) AddTenantID(v int64) *AliyunAvatarUpsert {
+func (u *AliyunAvatarUpsert) AddTenantID(v uint64) *AliyunAvatarUpsert {
 	u.Add(aliyunavatar.FieldTenantID, v)
 	return u
 }
@@ -702,14 +702,14 @@ func (u *AliyunAvatarUpsertOne) ClearAppID() *AliyunAvatarUpsertOne {
 }
 
 // SetTenantID sets the "tenant_id" field.
-func (u *AliyunAvatarUpsertOne) SetTenantID(v int64) *AliyunAvatarUpsertOne {
+func (u *AliyunAvatarUpsertOne) SetTenantID(v uint64) *AliyunAvatarUpsertOne {
 	return u.Update(func(s *AliyunAvatarUpsert) {
 		s.SetTenantID(v)
 	})
 }
 
 // AddTenantID adds v to the "tenant_id" field.
-func (u *AliyunAvatarUpsertOne) AddTenantID(v int64) *AliyunAvatarUpsertOne {
+func (u *AliyunAvatarUpsertOne) AddTenantID(v uint64) *AliyunAvatarUpsertOne {
 	return u.Update(func(s *AliyunAvatarUpsert) {
 		s.AddTenantID(v)
 	})
@@ -1101,14 +1101,14 @@ func (u *AliyunAvatarUpsertBulk) ClearAppID() *AliyunAvatarUpsertBulk {
 }
 
 // SetTenantID sets the "tenant_id" field.
-func (u *AliyunAvatarUpsertBulk) SetTenantID(v int64) *AliyunAvatarUpsertBulk {
+func (u *AliyunAvatarUpsertBulk) SetTenantID(v uint64) *AliyunAvatarUpsertBulk {
 	return u.Update(func(s *AliyunAvatarUpsert) {
 		s.SetTenantID(v)
 	})
 }
 
 // AddTenantID adds v to the "tenant_id" field.
-func (u *AliyunAvatarUpsertBulk) AddTenantID(v int64) *AliyunAvatarUpsertBulk {
+func (u *AliyunAvatarUpsertBulk) AddTenantID(v uint64) *AliyunAvatarUpsertBulk {
 	return u.Update(func(s *AliyunAvatarUpsert) {
 		s.AddTenantID(v)
 	})

+ 20 - 20
ent/aliyunavatar_update.go

@@ -138,23 +138,23 @@ func (aau *AliyunAvatarUpdate) ClearAppID() *AliyunAvatarUpdate {
 }
 
 // SetTenantID sets the "tenant_id" field.
-func (aau *AliyunAvatarUpdate) SetTenantID(i int64) *AliyunAvatarUpdate {
+func (aau *AliyunAvatarUpdate) SetTenantID(u uint64) *AliyunAvatarUpdate {
 	aau.mutation.ResetTenantID()
-	aau.mutation.SetTenantID(i)
+	aau.mutation.SetTenantID(u)
 	return aau
 }
 
 // SetNillableTenantID sets the "tenant_id" field if the given value is not nil.
-func (aau *AliyunAvatarUpdate) SetNillableTenantID(i *int64) *AliyunAvatarUpdate {
-	if i != nil {
-		aau.SetTenantID(*i)
+func (aau *AliyunAvatarUpdate) SetNillableTenantID(u *uint64) *AliyunAvatarUpdate {
+	if u != nil {
+		aau.SetTenantID(*u)
 	}
 	return aau
 }
 
-// AddTenantID adds i to the "tenant_id" field.
-func (aau *AliyunAvatarUpdate) AddTenantID(i int64) *AliyunAvatarUpdate {
-	aau.mutation.AddTenantID(i)
+// AddTenantID adds u to the "tenant_id" field.
+func (aau *AliyunAvatarUpdate) AddTenantID(u int64) *AliyunAvatarUpdate {
+	aau.mutation.AddTenantID(u)
 	return aau
 }
 
@@ -287,10 +287,10 @@ func (aau *AliyunAvatarUpdate) sqlSave(ctx context.Context) (n int, err error) {
 		_spec.ClearField(aliyunavatar.FieldAppID, field.TypeString)
 	}
 	if value, ok := aau.mutation.TenantID(); ok {
-		_spec.SetField(aliyunavatar.FieldTenantID, field.TypeInt64, value)
+		_spec.SetField(aliyunavatar.FieldTenantID, field.TypeUint64, value)
 	}
 	if value, ok := aau.mutation.AddedTenantID(); ok {
-		_spec.AddField(aliyunavatar.FieldTenantID, field.TypeInt64, value)
+		_spec.AddField(aliyunavatar.FieldTenantID, field.TypeUint64, value)
 	}
 	if value, ok := aau.mutation.Response(); ok {
 		_spec.SetField(aliyunavatar.FieldResponse, field.TypeString, value)
@@ -431,23 +431,23 @@ func (aauo *AliyunAvatarUpdateOne) ClearAppID() *AliyunAvatarUpdateOne {
 }
 
 // SetTenantID sets the "tenant_id" field.
-func (aauo *AliyunAvatarUpdateOne) SetTenantID(i int64) *AliyunAvatarUpdateOne {
+func (aauo *AliyunAvatarUpdateOne) SetTenantID(u uint64) *AliyunAvatarUpdateOne {
 	aauo.mutation.ResetTenantID()
-	aauo.mutation.SetTenantID(i)
+	aauo.mutation.SetTenantID(u)
 	return aauo
 }
 
 // SetNillableTenantID sets the "tenant_id" field if the given value is not nil.
-func (aauo *AliyunAvatarUpdateOne) SetNillableTenantID(i *int64) *AliyunAvatarUpdateOne {
-	if i != nil {
-		aauo.SetTenantID(*i)
+func (aauo *AliyunAvatarUpdateOne) SetNillableTenantID(u *uint64) *AliyunAvatarUpdateOne {
+	if u != nil {
+		aauo.SetTenantID(*u)
 	}
 	return aauo
 }
 
-// AddTenantID adds i to the "tenant_id" field.
-func (aauo *AliyunAvatarUpdateOne) AddTenantID(i int64) *AliyunAvatarUpdateOne {
-	aauo.mutation.AddTenantID(i)
+// AddTenantID adds u to the "tenant_id" field.
+func (aauo *AliyunAvatarUpdateOne) AddTenantID(u int64) *AliyunAvatarUpdateOne {
+	aauo.mutation.AddTenantID(u)
 	return aauo
 }
 
@@ -610,10 +610,10 @@ func (aauo *AliyunAvatarUpdateOne) sqlSave(ctx context.Context) (_node *AliyunAv
 		_spec.ClearField(aliyunavatar.FieldAppID, field.TypeString)
 	}
 	if value, ok := aauo.mutation.TenantID(); ok {
-		_spec.SetField(aliyunavatar.FieldTenantID, field.TypeInt64, value)
+		_spec.SetField(aliyunavatar.FieldTenantID, field.TypeUint64, value)
 	}
 	if value, ok := aauo.mutation.AddedTenantID(); ok {
-		_spec.AddField(aliyunavatar.FieldTenantID, field.TypeInt64, value)
+		_spec.AddField(aliyunavatar.FieldTenantID, field.TypeUint64, value)
 	}
 	if value, ok := aauo.mutation.Response(); ok {
 		_spec.SetField(aliyunavatar.FieldResponse, field.TypeString, value)

+ 1 - 1
ent/migrate/schema.go

@@ -67,7 +67,7 @@ var (
 		{Name: "access_key_id", Type: field.TypeString, Comment: "access_key_id | AccessKeyId"},
 		{Name: "access_key_secret", Type: field.TypeString, Comment: "access_key_secret | AccessKeySecret"},
 		{Name: "app_id", Type: field.TypeString, Nullable: true, Comment: "app_id | AppId"},
-		{Name: "tenant_id", Type: field.TypeInt64, Comment: "tenant_id | TenantId"},
+		{Name: "tenant_id", Type: field.TypeUint64, Comment: "tenant_id | TenantId"},
 		{Name: "response", Type: field.TypeString, Size: 2147483647, Comment: "response | 阿里云avatar响应"},
 		{Name: "token", Type: field.TypeString, Comment: "token | Token", Default: ""},
 		{Name: "session_id", Type: field.TypeString, Comment: "session_id | SessionId", Default: ""},

+ 10 - 10
ent/mutation.go

@@ -2306,7 +2306,7 @@ type AliyunAvatarMutation struct {
 	access_key_id     *string
 	access_key_secret *string
 	app_id            *string
-	tenant_id         *int64
+	tenant_id         *uint64
 	addtenant_id      *int64
 	response          *string
 	token             *string
@@ -2756,13 +2756,13 @@ func (m *AliyunAvatarMutation) ResetAppID() {
 }
 
 // SetTenantID sets the "tenant_id" field.
-func (m *AliyunAvatarMutation) SetTenantID(i int64) {
-	m.tenant_id = &i
+func (m *AliyunAvatarMutation) SetTenantID(u uint64) {
+	m.tenant_id = &u
 	m.addtenant_id = nil
 }
 
 // TenantID returns the value of the "tenant_id" field in the mutation.
-func (m *AliyunAvatarMutation) TenantID() (r int64, exists bool) {
+func (m *AliyunAvatarMutation) TenantID() (r uint64, exists bool) {
 	v := m.tenant_id
 	if v == nil {
 		return
@@ -2773,7 +2773,7 @@ func (m *AliyunAvatarMutation) TenantID() (r int64, exists bool) {
 // OldTenantID returns the old "tenant_id" field's value of the AliyunAvatar entity.
 // If the AliyunAvatar object wasn't provided to the builder, the object is fetched from the database.
 // An error is returned if the mutation operation is not UpdateOne, or the database query fails.
-func (m *AliyunAvatarMutation) OldTenantID(ctx context.Context) (v int64, err error) {
+func (m *AliyunAvatarMutation) OldTenantID(ctx context.Context) (v uint64, err error) {
 	if !m.op.Is(OpUpdateOne) {
 		return v, errors.New("OldTenantID is only allowed on UpdateOne operations")
 	}
@@ -2787,12 +2787,12 @@ func (m *AliyunAvatarMutation) OldTenantID(ctx context.Context) (v int64, err er
 	return oldValue.TenantID, nil
 }
 
-// AddTenantID adds i to the "tenant_id" field.
-func (m *AliyunAvatarMutation) AddTenantID(i int64) {
+// AddTenantID adds u to the "tenant_id" field.
+func (m *AliyunAvatarMutation) AddTenantID(u int64) {
 	if m.addtenant_id != nil {
-		*m.addtenant_id += i
+		*m.addtenant_id += u
 	} else {
-		m.addtenant_id = &i
+		m.addtenant_id = &u
 	}
 }
 
@@ -3121,7 +3121,7 @@ func (m *AliyunAvatarMutation) SetField(name string, value ent.Value) error {
 		m.SetAppID(v)
 		return nil
 	case aliyunavatar.FieldTenantID:
-		v, ok := value.(int64)
+		v, ok := value.(uint64)
 		if !ok {
 			return fmt.Errorf("unexpected type %T for field %s", value, name)
 		}

+ 1 - 1
ent/schema/aliyun_avatar.go

@@ -22,7 +22,7 @@ func (AliyunAvatar) Fields() []ent.Field {
 		field.String("access_key_id").Comment("access_key_id | AccessKeyId"),
 		field.String("access_key_secret").Comment("access_key_secret | AccessKeySecret"),
 		field.String("app_id").Optional().Comment("app_id | AppId"),
-		field.Int64("tenant_id").Comment("tenant_id | TenantId"),
+		field.Uint64("tenant_id").Comment("tenant_id | TenantId"),
 		field.Text("response").Comment("response | 阿里云avatar响应"),
 		field.String("token").Default("").Comment("token | Token"),
 		field.String("session_id").Default("").Comment("session_id | SessionId"),

+ 3 - 3
ent/set_not_nil.go

@@ -632,7 +632,7 @@ func (aa *AliyunAvatarCreate) SetNotNilAppID(value *string) *AliyunAvatarCreate
 }
 
 // set field if value's pointer is not nil.
-func (aa *AliyunAvatarUpdate) SetNotNilTenantID(value *int64) *AliyunAvatarUpdate {
+func (aa *AliyunAvatarUpdate) SetNotNilTenantID(value *uint64) *AliyunAvatarUpdate {
 	if value != nil {
 		return aa.SetTenantID(*value)
 	}
@@ -640,7 +640,7 @@ func (aa *AliyunAvatarUpdate) SetNotNilTenantID(value *int64) *AliyunAvatarUpdat
 }
 
 // set field if value's pointer is not nil.
-func (aa *AliyunAvatarUpdateOne) SetNotNilTenantID(value *int64) *AliyunAvatarUpdateOne {
+func (aa *AliyunAvatarUpdateOne) SetNotNilTenantID(value *uint64) *AliyunAvatarUpdateOne {
 	if value != nil {
 		return aa.SetTenantID(*value)
 	}
@@ -648,7 +648,7 @@ func (aa *AliyunAvatarUpdateOne) SetNotNilTenantID(value *int64) *AliyunAvatarUp
 }
 
 // set field if value's pointer is not nil.
-func (aa *AliyunAvatarCreate) SetNotNilTenantID(value *int64) *AliyunAvatarCreate {
+func (aa *AliyunAvatarCreate) SetNotNilTenantID(value *uint64) *AliyunAvatarCreate {
 	if value != nil {
 		return aa.SetTenantID(*value)
 	}

+ 1 - 1
hook/aliyun/aitypes.go

@@ -7,6 +7,6 @@ type AiTypes struct {
 	AccessKeyId     string `json:"access_key_id"`
 	AccessKeySecret string `json:"access_key_secret"`
 	AppId           string `json:"app_id"`
-	TenantId        int64  `json:"tenant_id"`
+	TenantId        uint64 `json:"tenant_id"`
 	SubscriptionKey string `json:"subscription_key,omitempty,optional"`
 }

+ 1 - 1
hook/aliyun/avatar.go

@@ -48,7 +48,7 @@ func StartInstance(userId uint64, jsonData AiTypes) (*avatar20220130.StartInstan
 	}
 
 	startInstanceRequest := &avatar20220130.StartInstanceRequest{
-		TenantId: tea.Int64(tenantId),
+		TenantId: tea.Int64(int64(tenantId)),
 		App: &avatar20220130.StartInstanceRequestApp{
 			AppId: tea.String(appId),
 		},

+ 19 - 0
hook/fastgpt/chat.go

@@ -16,6 +16,25 @@ type ChatResp struct {
 	Choices []Choice `json:"choices"`
 }
 
+type ChatNoStreamResp struct {
+	Id      string           `json:"id"`
+	Model   string           `json:"model"`
+	Usage   Usage            `json:"usage"`
+	Choices []NoStreamChoice `json:"choices"`
+}
+
+type NoStreamChoice struct {
+	Message      Delta  `json:"message"`
+	FinishReason string `json:"finish_reason,optional"`
+	Index        uint64 `json:"index"`
+}
+
+type Usage struct {
+	PromptTokens     int `json:"prompt_tokens"`
+	CompletionTokens int `json:"completion_tokens"`
+	TotalTokens      int `json:"total_tokens"`
+}
+
 type Choice struct {
 	Delta        Delta  `json:"delta"`
 	FinishReason string `json:"finish_reason,optional"`

+ 44 - 0
internal/handler/aliyun_avatar/create_aliyun_avatar_handler.go

@@ -0,0 +1,44 @@
+package aliyun_avatar
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/aliyun_avatar"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /aliyun_avatar/create aliyun_avatar CreateAliyunAvatar
+//
+// Create aliyun avatar information | 创建AliyunAvatar
+//
+// Create aliyun avatar information | 创建AliyunAvatar
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: AliyunAvatarInfo
+//
+// Responses:
+//  200: BaseMsgResp
+
+func CreateAliyunAvatarHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.AliyunAvatarInfo
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := aliyun_avatar.NewCreateAliyunAvatarLogic(r.Context(), svcCtx)
+		resp, err := l.CreateAliyunAvatar(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/aliyun_avatar/delete_aliyun_avatar_handler.go

@@ -0,0 +1,44 @@
+package aliyun_avatar
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/aliyun_avatar"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /aliyun_avatar/delete aliyun_avatar DeleteAliyunAvatar
+//
+// Delete aliyun avatar information | 删除AliyunAvatar信息
+//
+// Delete aliyun avatar information | 删除AliyunAvatar信息
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: IDsReq
+//
+// Responses:
+//  200: BaseMsgResp
+
+func DeleteAliyunAvatarHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.IDsReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := aliyun_avatar.NewDeleteAliyunAvatarLogic(r.Context(), svcCtx)
+		resp, err := l.DeleteAliyunAvatar(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/aliyun_avatar/get_aliyun_avatar_by_id_handler.go

@@ -0,0 +1,44 @@
+package aliyun_avatar
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/aliyun_avatar"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /aliyun_avatar aliyun_avatar GetAliyunAvatarById
+//
+// Get aliyun avatar by ID | 通过ID获取AliyunAvatar
+//
+// Get aliyun avatar by ID | 通过ID获取AliyunAvatar
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: IDReq
+//
+// Responses:
+//  200: AliyunAvatarInfoResp
+
+func GetAliyunAvatarByIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.IDReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := aliyun_avatar.NewGetAliyunAvatarByIdLogic(r.Context(), svcCtx)
+		resp, err := l.GetAliyunAvatarById(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/aliyun_avatar/get_aliyun_avatar_list_handler.go

@@ -0,0 +1,44 @@
+package aliyun_avatar
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/aliyun_avatar"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /aliyun_avatar/list aliyun_avatar GetAliyunAvatarList
+//
+// Get aliyun avatar list | 获取AliyunAvatar列表
+//
+// Get aliyun avatar list | 获取AliyunAvatar列表
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: AliyunAvatarListReq
+//
+// Responses:
+//  200: AliyunAvatarListResp
+
+func GetAliyunAvatarListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.AliyunAvatarListReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := aliyun_avatar.NewGetAliyunAvatarListLogic(r.Context(), svcCtx)
+		resp, err := l.GetAliyunAvatarList(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/aliyun_avatar/update_aliyun_avatar_handler.go

@@ -0,0 +1,44 @@
+package aliyun_avatar
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/aliyun_avatar"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /aliyun_avatar/update aliyun_avatar UpdateAliyunAvatar
+//
+// Update aliyun avatar information | 更新AliyunAvatar
+//
+// Update aliyun avatar information | 更新AliyunAvatar
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: AliyunAvatarInfo
+//
+// Responses:
+//  200: BaseMsgResp
+
+func UpdateAliyunAvatarHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.AliyunAvatarInfo
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := aliyun_avatar.NewUpdateAliyunAvatarLogic(r.Context(), svcCtx)
+		resp, err := l.UpdateAliyunAvatar(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/chatrecords/answer_api_chat_handler.go

@@ -0,0 +1,44 @@
+package chatrecords
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/chatrecords"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /api/chat/answer chatrecords AnswerApiChat
+//
+// Create chat records information | 创建ChatRecords
+//
+// Create chat records information | 创建ChatRecords
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: ChatAskReq
+//
+// Responses:
+//  200: ChatAskResp
+
+func AnswerApiChatHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.ChatAskReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := chatrecords.NewAnswerApiChatLogic(r.Context(), svcCtx)
+		resp, err := l.AnswerApiChat(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 40 - 0
internal/handler/routes.go

@@ -13,6 +13,7 @@ import (
 	Wxhook "wechat-api/internal/handler/Wxhook"
 	agent "wechat-api/internal/handler/agent"
 	agent_base "wechat-api/internal/handler/agent_base"
+	aliyun_avatar "wechat-api/internal/handler/aliyun_avatar"
 	avatar "wechat-api/internal/handler/avatar"
 	base "wechat-api/internal/handler/base"
 	batch_msg "wechat-api/internal/handler/batch_msg"
@@ -1020,6 +1021,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				},
 				{
 					Method:  http.MethodPost,
+					Path:    "/api/chat/answer",
+					Handler: chatrecords.AnswerApiChatHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
 					Path:    "/api/chat/list",
 					Handler: chatrecords.GetApiChatListHandler(serverCtx),
 				},
@@ -1307,4 +1313,38 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 		),
 		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
 	)
+
+	server.AddRoutes(
+		rest.WithMiddlewares(
+			[]rest.Middleware{serverCtx.Authority},
+			[]rest.Route{
+				{
+					Method:  http.MethodPost,
+					Path:    "/aliyun_avatar/create",
+					Handler: aliyun_avatar.CreateAliyunAvatarHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/aliyun_avatar/update",
+					Handler: aliyun_avatar.UpdateAliyunAvatarHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/aliyun_avatar/delete",
+					Handler: aliyun_avatar.DeleteAliyunAvatarHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/aliyun_avatar/list",
+					Handler: aliyun_avatar.GetAliyunAvatarListHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/aliyun_avatar",
+					Handler: aliyun_avatar.GetAliyunAvatarByIdHandler(serverCtx),
+				},
+			}...,
+		),
+		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
+	)
 }

+ 15 - 15
internal/logic/aliyun_avatar/create_aliyun_avatar_logic.go

@@ -7,7 +7,7 @@ import (
 	"wechat-api/internal/types"
 	"wechat-api/internal/utils/dberrorhandler"
 
-    "github.com/suyuan32/simple-admin-common/msg/errormsg"
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
 
 	"github.com/zeromicro/go-zero/core/logx"
 )
@@ -27,21 +27,21 @@ func NewCreateAliyunAvatarLogic(ctx context.Context, svcCtx *svc.ServiceContext)
 }
 
 func (l *CreateAliyunAvatarLogic) CreateAliyunAvatar(req *types.AliyunAvatarInfo) (*types.BaseMsgResp, error) {
-    _, err := l.svcCtx.DB.AliyunAvatar.Create().
-			SetNotNilUserID(req.UserId).
-			SetNotNilBizID(req.BizId).
-			SetNotNilAccessKeyID(req.AccessKeyId).
-			SetNotNilAccessKeySecret(req.AccessKeySecret).
-			SetNotNilAppID(req.AppId).
-			SetNotNilTenantD(req.TenantD).
-			SetNotNilResponse(req.Response).
-			SetNotNilToken(req.Token).
-			SetNotNilSessionID(req.SessionId).
-			Save(l.ctx)
-
-    if err != nil {
+	_, err := l.svcCtx.DB.AliyunAvatar.Create().
+		SetNotNilUserID(req.UserId).
+		SetNotNilBizID(req.BizId).
+		SetNotNilAccessKeyID(req.AccessKeyId).
+		SetNotNilAccessKeySecret(req.AccessKeySecret).
+		SetNotNilAppID(req.AppId).
+		SetNotNilTenantID(req.TenantId).
+		SetNotNilResponse(req.Response).
+		SetNotNilToken(req.Token).
+		SetNotNilSessionID(req.SessionId).
+		Save(l.ctx)
+
+	if err != nil {
 		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
 	}
 
-    return &types.BaseMsgResp{Msg: errormsg.CreateSuccess}, nil
+	return &types.BaseMsgResp{Msg: errormsg.CreateSuccess}, nil
 }

+ 21 - 22
internal/logic/aliyun_avatar/get_aliyun_avatar_by_id_logic.go

@@ -7,7 +7,7 @@ import (
 	"wechat-api/internal/types"
 	"wechat-api/internal/utils/dberrorhandler"
 
-    "github.com/suyuan32/simple-admin-common/msg/errormsg"
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
 
 	"github.com/suyuan32/simple-admin-common/utils/pointy"
 	"github.com/zeromicro/go-zero/core/logx"
@@ -34,26 +34,25 @@ func (l *GetAliyunAvatarByIdLogic) GetAliyunAvatarById(req *types.IDReq) (*types
 	}
 
 	return &types.AliyunAvatarInfoResp{
-	    BaseDataInfo: types.BaseDataInfo{
-            Code: 0,
-            Msg:  errormsg.Success,
-        },
-        Data: types.AliyunAvatarInfo{
-            BaseIDInfo:    types.BaseIDInfo{
-				Id:          &data.ID,
-				CreatedAt:    pointy.GetPointer(data.CreatedAt.UnixMilli()),
-				UpdatedAt:    pointy.GetPointer(data.UpdatedAt.UnixMilli()),
-            },
-			UserId:	&data.UserID,
-			BizId:	&data.BizID,
-			AccessKeyId:	&data.AccessKeyID,
-			AccessKeySecret:	&data.AccessKeySecret,
-			AppId:	&data.AppID,
-			TenantD:	&data.TenantD,
-			Response:	&data.Response,
-			Token:	&data.Token,
-			SessionId:	&data.SessionID,
-        },
+		BaseDataInfo: types.BaseDataInfo{
+			Code: 0,
+			Msg:  errormsg.Success,
+		},
+		Data: types.AliyunAvatarInfo{
+			BaseIDInfo: types.BaseIDInfo{
+				Id:        &data.ID,
+				CreatedAt: pointy.GetPointer(data.CreatedAt.UnixMilli()),
+				UpdatedAt: pointy.GetPointer(data.UpdatedAt.UnixMilli()),
+			},
+			UserId:          &data.UserID,
+			BizId:           &data.BizID,
+			AccessKeyId:     &data.AccessKeyID,
+			AccessKeySecret: &data.AccessKeySecret,
+			AppId:           &data.AppID,
+			TenantId:        &data.TenantID,
+			Response:        &data.Response,
+			Token:           &data.Token,
+			SessionId:       &data.SessionID,
+		},
 	}, nil
 }
-

+ 17 - 17
internal/logic/aliyun_avatar/get_aliyun_avatar_list_logic.go

@@ -9,7 +9,7 @@ import (
 	"wechat-api/internal/types"
 	"wechat-api/internal/utils/dberrorhandler"
 
-    "github.com/suyuan32/simple-admin-common/msg/errormsg"
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
 
 	"github.com/suyuan32/simple-admin-common/utils/pointy"
 	"github.com/zeromicro/go-zero/core/logx"
@@ -52,22 +52,22 @@ func (l *GetAliyunAvatarListLogic) GetAliyunAvatarList(req *types.AliyunAvatarLi
 
 	for _, v := range data.List {
 		resp.Data.Data = append(resp.Data.Data,
-		types.AliyunAvatarInfo{
-			BaseIDInfo:    types.BaseIDInfo{
-				Id:          &v.ID,
-				CreatedAt:    pointy.GetPointer(v.CreatedAt.UnixMilli()),
-				UpdatedAt:    pointy.GetPointer(v.UpdatedAt.UnixMilli()),
-            },
-			UserId:	&v.UserID,
-			BizId:	&v.BizID,
-			AccessKeyId:	&v.AccessKeyID,
-			AccessKeySecret:	&v.AccessKeySecret,
-			AppId:	&v.AppID,
-			TenantD:	&v.TenantD,
-			Response:	&v.Response,
-			Token:	&v.Token,
-			SessionId:	&v.SessionID,
-		})
+			types.AliyunAvatarInfo{
+				BaseIDInfo: types.BaseIDInfo{
+					Id:        &v.ID,
+					CreatedAt: pointy.GetPointer(v.CreatedAt.UnixMilli()),
+					UpdatedAt: pointy.GetPointer(v.UpdatedAt.UnixMilli()),
+				},
+				UserId:          &v.UserID,
+				BizId:           &v.BizID,
+				AccessKeyId:     &v.AccessKeyID,
+				AccessKeySecret: &v.AccessKeySecret,
+				AppId:           &v.AppID,
+				TenantId:        &v.TenantID,
+				Response:        &v.Response,
+				Token:           &v.Token,
+				SessionId:       &v.SessionID,
+			})
 	}
 
 	return resp, nil

+ 14 - 15
internal/logic/aliyun_avatar/update_aliyun_avatar_logic.go

@@ -7,7 +7,6 @@ import (
 	"wechat-api/internal/types"
 	"wechat-api/internal/utils/dberrorhandler"
 
-
 	"github.com/suyuan32/simple-admin-common/msg/errormsg"
 	"github.com/zeromicro/go-zero/core/logx"
 )
@@ -27,21 +26,21 @@ func NewUpdateAliyunAvatarLogic(ctx context.Context, svcCtx *svc.ServiceContext)
 }
 
 func (l *UpdateAliyunAvatarLogic) UpdateAliyunAvatar(req *types.AliyunAvatarInfo) (*types.BaseMsgResp, error) {
-    err := l.svcCtx.DB.AliyunAvatar.UpdateOneID(*req.Id).
-			SetNotNilUserID(req.UserId).
-			SetNotNilBizID(req.BizId).
-			SetNotNilAccessKeyID(req.AccessKeyId).
-			SetNotNilAccessKeySecret(req.AccessKeySecret).
-			SetNotNilAppID(req.AppId).
-			SetNotNilTenantD(req.TenantD).
-			SetNotNilResponse(req.Response).
-			SetNotNilToken(req.Token).
-			SetNotNilSessionID(req.SessionId).
-			Exec(l.ctx)
-
-    if err != nil {
+	err := l.svcCtx.DB.AliyunAvatar.UpdateOneID(*req.Id).
+		SetNotNilUserID(req.UserId).
+		SetNotNilBizID(req.BizId).
+		SetNotNilAccessKeyID(req.AccessKeyId).
+		SetNotNilAccessKeySecret(req.AccessKeySecret).
+		SetNotNilAppID(req.AppId).
+		SetNotNilTenantID(req.TenantId).
+		SetNotNilResponse(req.Response).
+		SetNotNilToken(req.Token).
+		SetNotNilSessionID(req.SessionId).
+		Exec(l.ctx)
+
+	if err != nil {
 		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
 	}
 
-    return &types.BaseMsgResp{Msg: errormsg.UpdateSuccess}, nil
+	return &types.BaseMsgResp{Msg: errormsg.UpdateSuccess}, nil
 }

+ 2 - 1
internal/logic/avatar/get_api_avatar_config_logic.go

@@ -5,6 +5,7 @@ import (
 	"encoding/json"
 	"fmt"
 	avatar20220130 "github.com/alibabacloud-go/avatar-20220130/v2/client"
+	"github.com/alibabacloud-go/tea/tea"
 	"github.com/suyuan32/simple-admin-common/msg/errormsg"
 	"github.com/zeromicro/go-zero/core/errorx"
 	"wechat-api/ent/wxcard"
@@ -64,7 +65,7 @@ func (l *GetApiAvatarConfigLogic) GetApiAvatarConfig(req *types.AvatarConfigReq)
 			SetNotNilAccessKeyID(&jsonData.AccessKeyId).
 			SetNotNilAccessKeySecret(&jsonData.AccessKeySecret).
 			SetNotNilAppID(&jsonData.AppId).
-			SetNotNilTenantID(&jsonData.TenantId).
+			SetNotNilTenantID(tea.Uint64(uint64(jsonData.TenantId))).
 			SetNotNilSessionID(aiData.SessionId).
 			SetResponse(aiData.String()).
 			SetNotNilToken(aiData.Token).

+ 100 - 0
internal/logic/chatrecords/answer_api_chat_logic.go

@@ -0,0 +1,100 @@
+package chatrecords
+
+import (
+	"bytes"
+	"context"
+	"encoding/json"
+	"fmt"
+	"github.com/alibabacloud-go/tea/tea"
+	"io"
+	"net/http"
+	"time"
+	"wechat-api/ent/wxcard"
+	"wechat-api/ent/wxcarduser"
+	"wechat-api/hook/fastgpt"
+	"wechat-api/internal/utils/dberrorhandler"
+	"wechat-api/internal/utils/jwt"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type AnswerApiChatLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewAnswerApiChatLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AnswerApiChatLogic {
+	return &AnswerApiChatLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *AnswerApiChatLogic) AnswerApiChat(req *types.ChatAskReq) (*types.ChatAskResp, error) {
+	resp := types.ChatAskResp{}
+	userId := l.ctx.Value("userId").(uint64)
+
+	card, err := l.svcCtx.DB.WxCard.Query().Where(wxcard.ID(*req.CardId)).Only(l.ctx)
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	userInfo, _ := l.svcCtx.DB.WxCardUser.Query().Where(wxcarduser.ID(userId)).First(l.ctx)
+
+	var chatReq fastgpt.ChatReq
+	chatReq.Stream = false
+	message := make([]fastgpt.Message, 0, 1)
+	message = append(message, fastgpt.Message{
+		Content: *req.Question,
+		Role:    "user",
+	})
+	chatReq.Messages = message
+	chatReq.ChatId = jwt.HashidsEncode(*req.SessionId)
+	chatReq.Variables = fastgpt.Variables{
+		Uid:  jwt.HashidsEncode(int(userId)),
+		Name: userInfo.Nickname,
+	}
+
+	// 設置請求體 (這裡是一個簡單的範例,你可以根據需要調整)
+	jsonData, _ := json.Marshal(chatReq)
+	fmt.Printf("request data:%v\n", string(jsonData))
+
+	// 建立HTTP請求
+	url := card.APIBase + fastgpt.GetChatUrl()
+	fmt.Printf("url=%v \n", url)
+	request, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
+	if err != nil {
+		fmt.Printf("Error creating request:%v", err)
+		return nil, err
+	}
+
+	// 設置請求頭
+	request.Header.Set("Content-Type", "application/json")
+	request.Header.Set("Authorization", "Bearer "+card.APIKey)
+
+	// 發送請求
+	client := &http.Client{
+		Timeout: time.Second * 60,
+	}
+	response, err := client.Do(request)
+	defer response.Body.Close()
+
+	// 对返回的内容进行处理
+	answerByte, _ := io.ReadAll(response.Body)
+	fmt.Printf("answer=%s\n", answerByte)
+
+	chatData := fastgpt.ChatNoStreamResp{}
+	err = json.Unmarshal(answerByte, &chatData)
+	if err != nil {
+		fmt.Printf("json unmarshall error:%v\n", err)
+		return nil, err
+	}
+	fmt.Printf("response=%v\n", chatData.Choices)
+	resp.Data = tea.String(chatData.Choices[0].Message.Content)
+
+	return &resp, nil
+}

+ 73 - 0
internal/types/types.go

@@ -2199,6 +2199,19 @@ type ChatRecommend struct {
 	SessionId uint64   `json:"sessionId"`
 }
 
+// swagger:model ChatAskReq
+type ChatAskReq struct {
+	CardId    *uint64 `json:"cardId"`
+	Question  *string `json:"question"`
+	SessionId *int    `json:"sessionId"`
+}
+
+// swagger:model ChatAskResp
+type ChatAskResp struct {
+	BaseDataInfo
+	Data *string `json:"data"`
+}
+
 // The data of chat session information | ChatSession信息
 // swagger:model ChatSessionInfo
 type ChatSessionInfo struct {
@@ -2523,3 +2536,63 @@ type SignatureInfo struct {
 	Policy         *string `json:"policy"`
 	Signature      *string `json:"signature"`
 }
+
+// The data of aliyun avatar information | AliyunAvatar信息
+// swagger:model AliyunAvatarInfo
+type AliyunAvatarInfo struct {
+	BaseIDInfo
+	// user_id | wx_card_user_id
+	UserId *uint64 `json:"userId,optional"`
+	// biz_id | BizId
+	BizId *string `json:"bizId,optional"`
+	// access_key_id | AccessKeyId
+	AccessKeyId *string `json:"accessKeyId,optional"`
+	// access_key_secret | AccessKeySecret
+	AccessKeySecret *string `json:"accessKeySecret,optional"`
+	// app_id | AppId
+	AppId *string `json:"appId,optional"`
+	// tenant_id | TenantId
+	TenantId *uint64 `json:"TenantId,optional"`
+	// response | 阿里云avatar响应
+	Response *string `json:"response,optional"`
+	// token | Token
+	Token *string `json:"token,optional"`
+	// session_id | SessionId
+	SessionId *string `json:"sessionId,optional"`
+}
+
+// The response data of aliyun avatar list | AliyunAvatar列表数据
+// swagger:model AliyunAvatarListResp
+type AliyunAvatarListResp struct {
+	BaseDataInfo
+	// AliyunAvatar list data | AliyunAvatar列表数据
+	Data AliyunAvatarListInfo `json:"data"`
+}
+
+// AliyunAvatar list data | AliyunAvatar列表数据
+// swagger:model AliyunAvatarListInfo
+type AliyunAvatarListInfo struct {
+	BaseListInfo
+	// The API list data | AliyunAvatar列表数据
+	Data []AliyunAvatarInfo `json:"data"`
+}
+
+// Get aliyun avatar list request params | AliyunAvatar列表请求参数
+// swagger:model AliyunAvatarListReq
+type AliyunAvatarListReq struct {
+	PageInfo
+	// biz_id | BizId
+	BizId *string `json:"bizId,optional"`
+	// access_key_id | AccessKeyId
+	AccessKeyId *string `json:"accessKeyId,optional"`
+	// access_key_secret | AccessKeySecret
+	AccessKeySecret *string `json:"accessKeySecret,optional"`
+}
+
+// AliyunAvatar information response | AliyunAvatar信息返回体
+// swagger:model AliyunAvatarInfoResp
+type AliyunAvatarInfoResp struct {
+	BaseDataInfo
+	// AliyunAvatar information | AliyunAvatar数据
+	Data AliyunAvatarInfo `json:"data"`
+}