diff --git a/configs/dev/logging.toml b/configs/dev/logging.toml index 8e68e94..b3b02a1 100644 --- a/configs/dev/logging.toml +++ b/configs/dev/logging.toml @@ -19,7 +19,7 @@ MaxThread = 2 [Logger.Hooks.Options] Debug = "false" DBType = "mysql" # sqlite3/mysql/postgres -DSN = "haibei:haibei@tcp(115.239.217.220:3306)/haibei?charset=utf8mb4&parseTime=True&loc=Local" +DSN = "haibei:haibei@tcp(36.133.78.46:3306)/haibei?charset=utf8mb4&parseTime=True&loc=Local" MaxOpenConns = "16" MaxIdleConns = "4" MaxLifetime = "86400" diff --git a/configs/dev/middleware.toml b/configs/dev/middleware.toml index 635d39e..011ddc3 100644 --- a/configs/dev/middleware.toml +++ b/configs/dev/middleware.toml @@ -43,7 +43,7 @@ CleanupInterval = 60 # seconds Path = "data/auth" [Middleware.Auth.Store.Redis] -Addr = "115.239.217.220:6379" # If empty, then use the same configuration as Storage.Cache.Redis +Addr = "36.133.78.46:6379" # If empty, then use the same configuration as Storage.Cache.Redis Username = "" Password = "123456" DB = 2 @@ -62,7 +62,7 @@ Expiration = 3600 CleanupInterval = 60 [Middleware.RateLimiter.Store.Redis] -Addr = "115.239.217.220:6379" # If empty, then use the same configuration as Storage.Cache.Redis +Addr = "36.133.78.46:6379" # If empty, then use the same configuration as Storage.Cache.Redis Username = "" Password = "123456" DB = 10 diff --git a/configs/dev/server.toml b/configs/dev/server.toml index aa78b44..9562123 100644 --- a/configs/dev/server.toml +++ b/configs/dev/server.toml @@ -36,7 +36,7 @@ CleanupInterval = 60 [Storage.Cache.Badger] Path = "data/cache" [Storage.Cache.Redis] -Addr = "115.239.217.220:6379" +Addr = "36.133.78.46:6379" Username = "" Password = "123456" DB = 0 @@ -46,7 +46,7 @@ Type = "mysql" # sqlite3/mysql/postgres # SQLite3 DSN #DSN = "data/haibei.db" # MySQL DSN -DSN = "haibei:haibei@tcp(115.239.217.220:3306)/haibei?charset=utf8mb4&parseTime=True&loc=Local" +DSN = "haibei:haibei@tcp(36.133.78.46:3306)/haibei?charset=utf8mb4&parseTime=True&loc=Local" # PostgreSQL DSN # DSN = "host=db user=postgres password=123456 dbname=haibei port=5432 sslmode=disable TimeZone=Asia/Shanghai" MaxLifetime = 86400 @@ -63,7 +63,7 @@ Height = 160 CacheType = "memory" # memory/redis [Util.Captcha.Redis] -Addr = "115.239.217.220:6379" # If empty, then use the same configuration as Storage.Cache.Redis +Addr = "36.133.78.46:6379" # If empty, then use the same configuration as Storage.Cache.Redis Username = "" Password = "123456" DB = 1 diff --git a/internal/mods/common/api/smsLog.api.go b/internal/mods/common/api/smsLog.api.go new file mode 100644 index 0000000..8880681 --- /dev/null +++ b/internal/mods/common/api/smsLog.api.go @@ -0,0 +1,116 @@ +package api + +import ( + "github.com/gin-gonic/gin" + "github.guxuan/haibei/internal/mods/common/biz" + "github.guxuan/haibei/internal/mods/common/schema" + "github.guxuan/haibei/pkg/util" +) + +// Defining the `SMSLog` api. +type SMSLog struct { + SMSLogBIZ *biz.SMSLog +} + +// @Tags 短信日志模块 +// @Security ApiKeyAuth +// @Summary Query smsLog list +// @Param current query int true "pagination index" default(1) +// @Param pageSize query int true "pagination size" default(10) +// @Success 200 {object} util.ResponseResult{data=[]schema.SMSLog} +// @Failure 401 {object} util.ResponseResult +// @Failure 500 {object} util.ResponseResult +// @Router /api/v1/smsLogs [get] +func (a *SMSLog) Query(c *gin.Context) { + ctx := c.Request.Context() + var params schema.SMSLogQueryParam + if err := util.ParseQuery(c, ¶ms); err != nil { + util.ResError(c, err) + return + } + result, err := a.SMSLogBIZ.Query(ctx, params) + if err != nil { + util.ResError(c, err) + return + } + util.ResPage(c, result.Data, result.PageResult) +} + +// @Tags 短信日志模块 +// @Security ApiKeyAuth +// @Summary Get smsLog record by ID +// @Param id path string true "unique id" +// @Success 200 {object} util.ResponseResult{data=schema.SMSLog} +// @Failure 401 {object} util.ResponseResult +// @Failure 500 {object} util.ResponseResult +// @Router /api/v1/smsLogs/{id} [get] +func (a *SMSLog) Get(c *gin.Context) { + ctx := c.Request.Context() + id, err := util.GetQueryID(c) + if err != nil { + util.ResError(c, err) + return + } + item, err := a.SMSLogBIZ.Get(ctx, id) + if err != nil { + util.ResError(c, err) + return + } + util.ResSuccess(c, item) +} + +// @Tags 短信日志模块 +// @Security ApiKeyAuth +// @Summary Update smsLog record by ID +// @Param id path string true "unique id" +// @Param body body schema.SMSLogForm true "Request body" +// @Success 200 {object} util.ResponseResult +// @Failure 400 {object} util.ResponseResult +// @Failure 401 {object} util.ResponseResult +// @Failure 500 {object} util.ResponseResult +// @Router /api/v1/smsLogs/{id} [put] +func (a *SMSLog) Update(c *gin.Context) { + ctx := c.Request.Context() + item := new(schema.SMSLogForm) + if err := util.ParseJSON(c, item); err != nil { + util.ResError(c, err) + return + } else if err := item.Validate(); err != nil { + util.ResError(c, err) + return + } + id, err := util.GetQueryID(c) + if err != nil { + util.ResError(c, err) + return + } + err = a.SMSLogBIZ.Update(ctx, id, item) + if err != nil { + util.ResError(c, err) + return + } + util.ResOK(c) +} + +// @Tags 短信日志模块 +// @Security ApiKeyAuth +// @Summary Delete smsLog record by ID +// @Param id path string true "unique id" +// @Success 200 {object} util.ResponseResult +// @Failure 401 {object} util.ResponseResult +// @Failure 500 {object} util.ResponseResult +// @Router /api/v1/smsLogs/{id} [delete] +func (a *SMSLog) Delete(c *gin.Context) { + ctx := c.Request.Context() + id, err := util.GetQueryID(c) + if err != nil { + util.ResError(c, err) + return + } + err = a.SMSLogBIZ.Delete(ctx, id) + if err != nil { + util.ResError(c, err) + return + } + util.ResOK(c) +} diff --git a/internal/mods/common/biz/smsLog.biz.go b/internal/mods/common/biz/smsLog.biz.go new file mode 100644 index 0000000..9b602a3 --- /dev/null +++ b/internal/mods/common/biz/smsLog.biz.go @@ -0,0 +1,103 @@ +package biz + +import ( + "context" + "github.guxuan/haibei/internal/mods/common/dal" + "github.guxuan/haibei/internal/mods/common/schema" + "github.guxuan/haibei/pkg/errors" + "github.guxuan/haibei/pkg/util" + "time" +) + +// Defining the `SMSLog` business logic. +type SMSLog struct { + Trans *util.Trans + SMSLogDAL *dal.SMSLog +} + +// 查询SMSLog列表 +func (a *SMSLog) Query(ctx context.Context, params schema.SMSLogQueryParam) (*schema.SMSLogQueryResult, error) { + params.Pagination = true + + result, err := a.SMSLogDAL.Query(ctx, params, schema.SMSLogQueryOptions{ + QueryOptions: util.QueryOptions{ + OrderFields: []util.OrderByParam{ + {Field: "created_at", Direction: util.DESC}, + }, + }, + }) + if err != nil { + return nil, err + } + return result, nil +} + +// 获取单条SMSLog +func (a *SMSLog) Get(ctx context.Context, id uint) (*schema.SMSLog, error) { + smsLog, err := a.SMSLogDAL.Get(ctx, id) + if err != nil { + return nil, err + } else if smsLog == nil { + return nil, errors.NotFound("", "SMSLog not found") + } + return smsLog, nil +} + +// 创建SMSLog +func (a *SMSLog) Create(ctx context.Context, formItem *schema.SMSLogForm) (*schema.SMSLog, error) { + smsLog := &schema.SMSLog{} + + if err := formItem.FillTo(smsLog); err != nil { + return nil, err + } + + err := a.Trans.Exec(ctx, func(ctx context.Context) error { + if err := a.SMSLogDAL.Create(ctx, smsLog); err != nil { + return err + } + return nil + }) + if err != nil { + return nil, err + } + return smsLog, nil +} + +// 修改SMSLog +func (a *SMSLog) Update(ctx context.Context, id uint, formItem *schema.SMSLogForm) error { + smsLog, err := a.SMSLogDAL.Get(ctx, id) + if err != nil { + return err + } else if smsLog == nil { + return errors.NotFound("", "SMSLog not found") + } + + if err := formItem.FillTo(smsLog); err != nil { + return err + } + smsLog.UpdatedAt = time.Now() + + return a.Trans.Exec(ctx, func(ctx context.Context) error { + if err := a.SMSLogDAL.Update(ctx, smsLog); err != nil { + return err + } + return nil + }) +} + +// 删除SMSLog +func (a *SMSLog) Delete(ctx context.Context, id uint) error { + exists, err := a.SMSLogDAL.Exists(ctx, id) + if err != nil { + return err + } else if !exists { + return errors.NotFound("", "SMSLog not found") + } + + return a.Trans.Exec(ctx, func(ctx context.Context) error { + if err := a.SMSLogDAL.Delete(ctx, id); err != nil { + return err + } + return nil + }) +} diff --git a/internal/mods/common/dal/smsLog.dal.go b/internal/mods/common/dal/smsLog.dal.go new file mode 100644 index 0000000..e9e80dc --- /dev/null +++ b/internal/mods/common/dal/smsLog.dal.go @@ -0,0 +1,82 @@ +package dal + +import ( + "context" + "github.guxuan/haibei/internal/mods/common/schema" + "github.guxuan/haibei/pkg/errors" + "github.guxuan/haibei/pkg/util" + "gorm.io/gorm" +) + +// Get smsLog storage instance +func GetSMSLogDB(ctx context.Context, defDB *gorm.DB) *gorm.DB { + return util.GetDB(ctx, defDB).Model(new(schema.SMSLog)) +} + +// Defining the `SMSLog` data access object. +type SMSLog struct { + DB *gorm.DB +} + +// 查询SMSLog列表 +func (a *SMSLog) Query(ctx context.Context, params schema.SMSLogQueryParam, opts ...schema.SMSLogQueryOptions) (*schema.SMSLogQueryResult, error) { + var opt schema.SMSLogQueryOptions + if len(opts) > 0 { + opt = opts[0] + } + + db := GetSMSLogDB(ctx, a.DB) + + var list schema.SMSLogs + pageResult, err := util.WrapPageQuery(ctx, db, params.PaginationParam, opt.QueryOptions, &list) + if err != nil { + return nil, errors.WithStack(err) + } + + queryResult := &schema.SMSLogQueryResult{ + PageResult: pageResult, + Data: list, + } + return queryResult, nil +} + +// 获取单条SMSLog +func (a *SMSLog) Get(ctx context.Context, id uint, opts ...schema.SMSLogQueryOptions) (*schema.SMSLog, error) { + var opt schema.SMSLogQueryOptions + if len(opts) > 0 { + opt = opts[0] + } + + item := new(schema.SMSLog) + ok, err := util.FindOne(ctx, GetSMSLogDB(ctx, a.DB).Where("id=?", id), opt.QueryOptions, item) + if err != nil { + return nil, errors.WithStack(err) + } else if !ok { + return nil, nil + } + return item, nil +} + +// 检查是否存在 +func (a *SMSLog) Exists(ctx context.Context, id uint) (bool, error) { + ok, err := util.Exists(ctx, GetSMSLogDB(ctx, a.DB).Where("id=?", id)) + return ok, errors.WithStack(err) +} + +// 创建SMSLog +func (a *SMSLog) Create(ctx context.Context, item *schema.SMSLog) error { + result := GetSMSLogDB(ctx, a.DB).Create(item) + return errors.WithStack(result.Error) +} + +// 修改SMSLog +func (a *SMSLog) Update(ctx context.Context, item *schema.SMSLog) error { + result := GetSMSLogDB(ctx, a.DB).Where("id=?", item.ID).Select("*").Omit("created_at").Updates(item) + return errors.WithStack(result.Error) +} + +// 删除SMSLog +func (a *SMSLog) Delete(ctx context.Context, id uint) error { + result := GetSMSLogDB(ctx, a.DB).Where("id=?", id).Delete(new(schema.SMSLog)) + return errors.WithStack(result.Error) +} diff --git a/internal/mods/common/main.go b/internal/mods/common/main.go index e23ac4d..aa4dc3f 100644 --- a/internal/mods/common/main.go +++ b/internal/mods/common/main.go @@ -20,10 +20,11 @@ type Common struct { AreaAPI *api.Area UploadAPI *api.Upload ReceptionCenterAPI *api.ReceptionCenter + SMSLogAPI *api.SMSLog } func (a *Common) AutoMigrate(ctx context.Context) error { - return a.DB.AutoMigrate(new(schema.Common), new(schema.Banner), new(schema.Notice), new(schema.Company), new(schema.Area), new(schema.ReceptionCenter), new(schema.SignIn)) + return a.DB.AutoMigrate(new(schema.Common), new(schema.Banner), new(schema.Notice), new(schema.Company), new(schema.Area), new(schema.ReceptionCenter), new(schema.SignIn), new(schema.SMSLog)) } func (a *Common) Init(ctx context.Context) error { @@ -91,6 +92,13 @@ func (a *Common) RegisterV1Routers(ctx context.Context, v1 *gin.RouterGroup) err reception.PUT(":id", a.ReceptionCenterAPI.Update) reception.DELETE(":id", a.ReceptionCenterAPI.Delete) } + smsLog := v1.Group("smsLogs") + { + smsLog.GET("", a.SMSLogAPI.Query) + smsLog.GET(":id", a.SMSLogAPI.Get) + smsLog.PUT(":id", a.SMSLogAPI.Update) + smsLog.DELETE(":id", a.SMSLogAPI.Delete) + } return nil } diff --git a/internal/mods/common/schema/smsLog.go b/internal/mods/common/schema/smsLog.go new file mode 100644 index 0000000..bb48404 --- /dev/null +++ b/internal/mods/common/schema/smsLog.go @@ -0,0 +1,62 @@ +package schema + +import ( + "github.guxuan/haibei/pkg/util" + "time" +) + +// Defining the `SmsLog` struct. +type SMSLog struct { + util.BaseModel + CustomerName string `json:"customerName" gorm:"index;comment:客户姓名"` //客户姓名 + Phone string `json:"phone" gorm:"size:20;index;comment:手机号"` //手机号 + SMSContent string `json:"SMSContent" gorm:"size:128;comment:短信内容"` //短信内容 + SMSType string `json:"smsType" gorm:"size:20;comment:短信类型"` ///短信类型 + SendAt time.Time `json:"sendAt" gorm:"size:32;comment:发送时间"` //发送时间 +} + +// Defining the query parameters for the `SmsLog` struct. +type SMSLogQueryParam struct { + util.PaginationParam + LikeName string `form:"likeName"` //客户姓名 + Phone string `form:"phone"` //手机号 + SMSType string `form:"smsType"` ///短信类型 +} + +// Defining the query options for the `SmsLog` struct. +type SMSLogQueryOptions struct { + util.QueryOptions +} + +// Defining the query result for the `SmsLog` struct. +type SMSLogQueryResult struct { + Data SMSLogs + PageResult *util.PaginationResult +} + +// Defining the slice of `SmsLog` struct. +type SMSLogs []*SMSLog + +// Defining the data structure for creating a `SmsLog` struct. +type SMSLogForm struct { + CustomerName string `json:"customerName"` //客户姓名 + Phone string `json:"phone"` //手机号 + SMSContent string `json:"SMSContent"` //短信内容 + SMSType string `json:"smsType"` ///短信类型 + SendAt time.Time `json:"sendAt"` //发送时间 +} + +// A validation function for the `SmsLogForm` struct. +func (a *SMSLogForm) Validate() error { + return nil +} + +// Convert `SmsLogForm` to `SmsLog` object. +func (a *SMSLogForm) FillTo(smsLog *SMSLog) error { + smsLog.CustomerName = a.CustomerName + smsLog.Phone = a.Phone + smsLog.SMSContent = a.SMSContent + smsLog.SMSType = a.SMSType + smsLog.SendAt = a.SendAt + return nil +} diff --git a/internal/mods/common/wire.go b/internal/mods/common/wire.go index 625268b..1807dad 100644 --- a/internal/mods/common/wire.go +++ b/internal/mods/common/wire.go @@ -28,4 +28,9 @@ var Set = wire.NewSet( wire.Struct(new(dal.Area), "*"), wire.Struct(new(biz.Area), "*"), wire.Struct(new(api.Area), "*"), + wire.Struct(new(dal.SMSLog), "*"), + wire.Struct(new(biz.SMSLog), "*"), + wire.Struct(new(api.SMSLog), "*"), + wire.Struct(new(biz.Upload), "*"), + wire.Struct(new(api.Upload), "*"), ) diff --git a/internal/swagger/docs.go b/internal/swagger/docs.go index 83d5261..c61e920 100644 --- a/internal/swagger/docs.go +++ b/internal/swagger/docs.go @@ -646,6 +646,39 @@ const docTemplate = `{ } } }, + "/api/v1/apps/home": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "APP端" + ], + "summary": "首页接口", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, "/api/v1/apps/login": { "post": { "security": [ @@ -679,6 +712,39 @@ const docTemplate = `{ } } }, + "/api/v1/apps/mine": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "APP端" + ], + "summary": "首页接口", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, "/api/v1/apps/sms/{phone}": { "get": { "security": [ @@ -2965,6 +3031,556 @@ const docTemplate = `{ } } }, + "/api/v1/house_articles": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房刊模块" + ], + "summary": "Query house list", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "pagination index", + "name": "current", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 10, + "description": "pagination size", + "name": "pageSize", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.HouseArticle" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房刊模块" + ], + "summary": "Create house record", + "parameters": [ + { + "description": "Request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.HouseArticleForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/schema.HouseArticle" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, + "/api/v1/house_articles/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房刊模块" + ], + "summary": "Get house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/schema.HouseArticle" + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房刊模块" + ], + "summary": "Update house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.HouseArticleForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房刊模块" + ], + "summary": "Delete house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, + "/api/v1/houses": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房源模块" + ], + "summary": "Query house list", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "pagination index", + "name": "current", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 10, + "description": "pagination size", + "name": "pageSize", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.House" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房源模块" + ], + "summary": "Create house record", + "parameters": [ + { + "description": "Request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.HouseForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/schema.House" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, + "/api/v1/houses/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房源模块" + ], + "summary": "Get house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/schema.House" + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房源模块" + ], + "summary": "Update house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.HouseForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房源模块" + ], + "summary": "Delete house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, "/api/v1/loggers": { "get": { "security": [ @@ -5474,7 +6090,8 @@ const docTemplate = `{ "data": { "type": "array", "items": { - "type": "integer" + "type": "integer", + "format": "int32" } } } @@ -5933,6 +6550,221 @@ const docTemplate = `{ } } }, + "/api/v1/smsLogs": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "短信日志模块" + ], + "summary": "Query smsLog list", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "pagination index", + "name": "current", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 10, + "description": "pagination size", + "name": "pageSize", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.SMSLog" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, + "/api/v1/smsLogs/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "短信日志模块" + ], + "summary": "Get smsLog record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/schema.SMSLog" + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "短信日志模块" + ], + "summary": "Update smsLog record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.SMSLogForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "短信日志模块" + ], + "summary": "Delete smsLog record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, "/api/v1/users": { "get": { "security": [ @@ -6456,6 +7288,20 @@ const docTemplate = `{ } } }, + "schema.Adviser": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": "string" + } + } + }, "schema.Area": { "type": "object", "properties": { @@ -6636,6 +7482,35 @@ const docTemplate = `{ } } }, + "schema.BasicInfo": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "area": { + "type": "string" + }, + "buildingarea": { + "type": "string" + }, + "masterType": { + "type": "string" + }, + "showAddress": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unitStruct": { + "type": "string" + } + } + }, "schema.Captcha": { "type": "object", "properties": { @@ -6665,6 +7540,38 @@ const docTemplate = `{ "schema.CommonForm": { "type": "object" }, + "schema.CommunityInfo": { + "type": "object", + "properties": { + "greeningRate": { + "type": "string" + }, + "packingNum": { + "type": "string" + }, + "propertyName": { + "type": "string" + }, + "propertyPrice": { + "type": "string" + }, + "propertyType": { + "type": "string" + }, + "r19009Ratio": { + "type": "string" + }, + "r19010Ratio": { + "type": "string" + }, + "r19011Ratio": { + "type": "string" + }, + "roomNUM": { + "type": "string" + } + } + }, "schema.Company": { "type": "object", "properties": { @@ -6814,6 +7721,20 @@ const docTemplate = `{ } } }, + "schema.Detail": { + "type": "object", + "properties": { + "basicInfo": { + "$ref": "#/definitions/schema.BasicInfo" + }, + "communityInfo": { + "$ref": "#/definitions/schema.CommunityInfo" + }, + "salesInfo": { + "$ref": "#/definitions/schema.SalesInfo" + } + } + }, "schema.Grade": { "type": "object", "properties": { @@ -6878,6 +7799,292 @@ const docTemplate = `{ } } }, + "schema.House": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "advisers": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.Adviser" + } + }, + "area": { + "type": "number" + }, + "areaId": { + "type": "integer" + }, + "cover": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "createdId": { + "type": "integer" + }, + "deletedAt": { + "type": "integer" + }, + "deletedId": { + "type": "integer" + }, + "detail": { + "$ref": "#/definitions/schema.Detail" + }, + "id": { + "type": "integer" + }, + "images": { + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "latitude": { + "type": "number" + }, + "layOuts": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.LayOut" + } + }, + "longitude": { + "type": "number" + }, + "masterType": { + "type": "string" + }, + "name": { + "type": "string" + }, + "openAt": { + "type": "string" + }, + "price": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "surroundings": { + "$ref": "#/definitions/schema.Surroundings" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "videos": { + "type": "array", + "items": { + "type": "string" + } + }, + "watchAvatars": { + "type": "array", + "items": { + "type": "string" + } + }, + "watchNum": { + "type": "integer" + } + } + }, + "schema.HouseArticle": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "cover": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "createdId": { + "type": "integer" + }, + "deletedAt": { + "type": "integer" + }, + "deletedId": { + "type": "integer" + }, + "houseId": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "pushAt": { + "type": "string" + }, + "status": { + "type": "string" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + } + }, + "schema.HouseArticleForm": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "cover": { + "type": "string" + }, + "houseId": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "pushAt": { + "type": "string" + }, + "status": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "schema.HouseForm": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "advisers": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.Adviser" + } + }, + "area": { + "type": "number" + }, + "areaId": { + "type": "integer" + }, + "cover": { + "type": "string" + }, + "detail": { + "$ref": "#/definitions/schema.Detail" + }, + "images": { + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "latitude": { + "type": "number" + }, + "layOuts": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.LayOut" + } + }, + "longitude": { + "type": "number" + }, + "masterType": { + "type": "string" + }, + "name": { + "type": "string" + }, + "openAt": { + "type": "string" + }, + "price": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "surroundings": { + "$ref": "#/definitions/schema.Surroundings" + }, + "title": { + "type": "string" + }, + "videos": { + "type": "array", + "items": { + "type": "string" + } + }, + "watchAvatars": { + "type": "array", + "items": { + "type": "string" + } + }, + "watchNum": { + "type": "integer" + } + } + }, + "schema.LayOut": { + "type": "object", + "properties": { + "area": { + "type": "number" + }, + "direction": { + "type": "string" + }, + "img": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "price": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, "schema.Logger": { "type": "object", "properties": { @@ -7802,6 +9009,114 @@ const docTemplate = `{ } } }, + "schema.SMSLog": { + "type": "object", + "properties": { + "SMSContent": { + "description": "短信内容", + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "createdId": { + "type": "integer" + }, + "customerName": { + "description": "客户姓名", + "type": "string" + }, + "deletedAt": { + "type": "integer" + }, + "deletedId": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "sendAt": { + "description": "发送时间", + "type": "string" + }, + "smsType": { + "description": "/短信类型", + "type": "string" + }, + "updatedAt": { + "type": "string" + } + } + }, + "schema.SMSLogForm": { + "type": "object", + "properties": { + "SMSContent": { + "description": "短信内容", + "type": "string" + }, + "customerName": { + "description": "客户姓名", + "type": "string" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "sendAt": { + "description": "发送时间", + "type": "string" + }, + "smsType": { + "description": "/短信类型", + "type": "string" + } + } + }, + "schema.SalesInfo": { + "type": "object", + "properties": { + "duration": { + "type": "string" + }, + "salesAddress": { + "type": "string" + }, + "salesPhone": { + "type": "string" + }, + "salesType": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "schema.Surroundings": { + "type": "object", + "properties": { + "busNum": { + "type": "integer" + }, + "hospitalNum": { + "type": "integer" + }, + "lifeNum": { + "type": "integer" + }, + "metroNum": { + "type": "integer" + }, + "schoolNum": { + "type": "integer" + } + } + }, "schema.UpdateCurrentUser": { "type": "object", "required": [ diff --git a/internal/swagger/swagger.json b/internal/swagger/swagger.json index df1ca45..e58142b 100644 --- a/internal/swagger/swagger.json +++ b/internal/swagger/swagger.json @@ -638,6 +638,39 @@ } } }, + "/api/v1/apps/home": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "APP端" + ], + "summary": "首页接口", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, "/api/v1/apps/login": { "post": { "security": [ @@ -671,6 +704,39 @@ } } }, + "/api/v1/apps/mine": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "APP端" + ], + "summary": "首页接口", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, "/api/v1/apps/sms/{phone}": { "get": { "security": [ @@ -2957,6 +3023,556 @@ } } }, + "/api/v1/house_articles": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房刊模块" + ], + "summary": "Query house list", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "pagination index", + "name": "current", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 10, + "description": "pagination size", + "name": "pageSize", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.HouseArticle" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房刊模块" + ], + "summary": "Create house record", + "parameters": [ + { + "description": "Request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.HouseArticleForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/schema.HouseArticle" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, + "/api/v1/house_articles/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房刊模块" + ], + "summary": "Get house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/schema.HouseArticle" + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房刊模块" + ], + "summary": "Update house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.HouseArticleForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房刊模块" + ], + "summary": "Delete house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, + "/api/v1/houses": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房源模块" + ], + "summary": "Query house list", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "pagination index", + "name": "current", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 10, + "description": "pagination size", + "name": "pageSize", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.House" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房源模块" + ], + "summary": "Create house record", + "parameters": [ + { + "description": "Request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.HouseForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/schema.House" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, + "/api/v1/houses/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房源模块" + ], + "summary": "Get house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/schema.House" + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房源模块" + ], + "summary": "Update house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.HouseForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "房源模块" + ], + "summary": "Delete house record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, "/api/v1/loggers": { "get": { "security": [ @@ -5466,7 +6082,8 @@ "data": { "type": "array", "items": { - "type": "integer" + "type": "integer", + "format": "int32" } } } @@ -5925,6 +6542,221 @@ } } }, + "/api/v1/smsLogs": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "短信日志模块" + ], + "summary": "Query smsLog list", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "pagination index", + "name": "current", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 10, + "description": "pagination size", + "name": "pageSize", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.SMSLog" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, + "/api/v1/smsLogs/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "短信日志模块" + ], + "summary": "Get smsLog record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/util.ResponseResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/schema.SMSLog" + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "短信日志模块" + ], + "summary": "Update smsLog record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema.SMSLogForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "短信日志模块" + ], + "summary": "Delete smsLog record by ID", + "parameters": [ + { + "type": "string", + "description": "unique id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/util.ResponseResult" + } + } + } + } + }, "/api/v1/users": { "get": { "security": [ @@ -6448,6 +7280,20 @@ } } }, + "schema.Adviser": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": "string" + } + } + }, "schema.Area": { "type": "object", "properties": { @@ -6628,6 +7474,35 @@ } } }, + "schema.BasicInfo": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "area": { + "type": "string" + }, + "buildingarea": { + "type": "string" + }, + "masterType": { + "type": "string" + }, + "showAddress": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unitStruct": { + "type": "string" + } + } + }, "schema.Captcha": { "type": "object", "properties": { @@ -6657,6 +7532,38 @@ "schema.CommonForm": { "type": "object" }, + "schema.CommunityInfo": { + "type": "object", + "properties": { + "greeningRate": { + "type": "string" + }, + "packingNum": { + "type": "string" + }, + "propertyName": { + "type": "string" + }, + "propertyPrice": { + "type": "string" + }, + "propertyType": { + "type": "string" + }, + "r19009Ratio": { + "type": "string" + }, + "r19010Ratio": { + "type": "string" + }, + "r19011Ratio": { + "type": "string" + }, + "roomNUM": { + "type": "string" + } + } + }, "schema.Company": { "type": "object", "properties": { @@ -6806,6 +7713,20 @@ } } }, + "schema.Detail": { + "type": "object", + "properties": { + "basicInfo": { + "$ref": "#/definitions/schema.BasicInfo" + }, + "communityInfo": { + "$ref": "#/definitions/schema.CommunityInfo" + }, + "salesInfo": { + "$ref": "#/definitions/schema.SalesInfo" + } + } + }, "schema.Grade": { "type": "object", "properties": { @@ -6870,6 +7791,292 @@ } } }, + "schema.House": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "advisers": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.Adviser" + } + }, + "area": { + "type": "number" + }, + "areaId": { + "type": "integer" + }, + "cover": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "createdId": { + "type": "integer" + }, + "deletedAt": { + "type": "integer" + }, + "deletedId": { + "type": "integer" + }, + "detail": { + "$ref": "#/definitions/schema.Detail" + }, + "id": { + "type": "integer" + }, + "images": { + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "latitude": { + "type": "number" + }, + "layOuts": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.LayOut" + } + }, + "longitude": { + "type": "number" + }, + "masterType": { + "type": "string" + }, + "name": { + "type": "string" + }, + "openAt": { + "type": "string" + }, + "price": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "surroundings": { + "$ref": "#/definitions/schema.Surroundings" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "videos": { + "type": "array", + "items": { + "type": "string" + } + }, + "watchAvatars": { + "type": "array", + "items": { + "type": "string" + } + }, + "watchNum": { + "type": "integer" + } + } + }, + "schema.HouseArticle": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "cover": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "createdId": { + "type": "integer" + }, + "deletedAt": { + "type": "integer" + }, + "deletedId": { + "type": "integer" + }, + "houseId": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "pushAt": { + "type": "string" + }, + "status": { + "type": "string" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + } + }, + "schema.HouseArticleForm": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "cover": { + "type": "string" + }, + "houseId": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "pushAt": { + "type": "string" + }, + "status": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "schema.HouseForm": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "advisers": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.Adviser" + } + }, + "area": { + "type": "number" + }, + "areaId": { + "type": "integer" + }, + "cover": { + "type": "string" + }, + "detail": { + "$ref": "#/definitions/schema.Detail" + }, + "images": { + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "latitude": { + "type": "number" + }, + "layOuts": { + "type": "array", + "items": { + "$ref": "#/definitions/schema.LayOut" + } + }, + "longitude": { + "type": "number" + }, + "masterType": { + "type": "string" + }, + "name": { + "type": "string" + }, + "openAt": { + "type": "string" + }, + "price": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "surroundings": { + "$ref": "#/definitions/schema.Surroundings" + }, + "title": { + "type": "string" + }, + "videos": { + "type": "array", + "items": { + "type": "string" + } + }, + "watchAvatars": { + "type": "array", + "items": { + "type": "string" + } + }, + "watchNum": { + "type": "integer" + } + } + }, + "schema.LayOut": { + "type": "object", + "properties": { + "area": { + "type": "number" + }, + "direction": { + "type": "string" + }, + "img": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "price": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, "schema.Logger": { "type": "object", "properties": { @@ -7794,6 +9001,114 @@ } } }, + "schema.SMSLog": { + "type": "object", + "properties": { + "SMSContent": { + "description": "短信内容", + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "createdId": { + "type": "integer" + }, + "customerName": { + "description": "客户姓名", + "type": "string" + }, + "deletedAt": { + "type": "integer" + }, + "deletedId": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "sendAt": { + "description": "发送时间", + "type": "string" + }, + "smsType": { + "description": "/短信类型", + "type": "string" + }, + "updatedAt": { + "type": "string" + } + } + }, + "schema.SMSLogForm": { + "type": "object", + "properties": { + "SMSContent": { + "description": "短信内容", + "type": "string" + }, + "customerName": { + "description": "客户姓名", + "type": "string" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "sendAt": { + "description": "发送时间", + "type": "string" + }, + "smsType": { + "description": "/短信类型", + "type": "string" + } + } + }, + "schema.SalesInfo": { + "type": "object", + "properties": { + "duration": { + "type": "string" + }, + "salesAddress": { + "type": "string" + }, + "salesPhone": { + "type": "string" + }, + "salesType": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "schema.Surroundings": { + "type": "object", + "properties": { + "busNum": { + "type": "integer" + }, + "hospitalNum": { + "type": "integer" + }, + "lifeNum": { + "type": "integer" + }, + "metroNum": { + "type": "integer" + }, + "schoolNum": { + "type": "integer" + } + } + }, "schema.UpdateCurrentUser": { "type": "object", "required": [ diff --git a/internal/swagger/swagger.yaml b/internal/swagger/swagger.yaml index 8474008..e864138 100644 --- a/internal/swagger/swagger.yaml +++ b/internal/swagger/swagger.yaml @@ -121,6 +121,15 @@ definitions: title: type: string type: object + schema.Adviser: + properties: + avatar: + type: string + name: + type: string + phone: + type: string + type: object schema.Area: properties: createdAt: @@ -239,6 +248,25 @@ definitions: status: type: string type: object + schema.BasicInfo: + properties: + address: + type: string + area: + type: string + buildingarea: + type: string + masterType: + type: string + showAddress: + type: string + status: + type: string + type: + type: string + unitStruct: + type: string + type: object schema.Captcha: properties: captcha_id: @@ -259,6 +287,27 @@ definitions: type: object schema.CommonForm: type: object + schema.CommunityInfo: + properties: + greeningRate: + type: string + packingNum: + type: string + propertyName: + type: string + propertyPrice: + type: string + propertyType: + type: string + r19009Ratio: + type: string + r19010Ratio: + type: string + r19011Ratio: + type: string + roomNUM: + type: string + type: object schema.Company: properties: areaId: @@ -357,6 +406,15 @@ definitions: wxSign: type: string type: object + schema.Detail: + properties: + basicInfo: + $ref: '#/definitions/schema.BasicInfo' + communityInfo: + $ref: '#/definitions/schema.CommunityInfo' + salesInfo: + $ref: '#/definitions/schema.SalesInfo' + type: object schema.Grade: properties: createdAt: @@ -399,6 +457,195 @@ definitions: status: type: string type: object + schema.House: + properties: + address: + type: string + advisers: + items: + $ref: '#/definitions/schema.Adviser' + type: array + area: + type: number + areaId: + type: integer + cover: + type: string + createdAt: + type: string + createdId: + type: integer + deletedAt: + type: integer + deletedId: + type: integer + detail: + $ref: '#/definitions/schema.Detail' + id: + type: integer + images: + items: + type: string + type: array + labels: + items: + type: string + type: array + latitude: + type: number + layOuts: + items: + $ref: '#/definitions/schema.LayOut' + type: array + longitude: + type: number + masterType: + type: string + name: + type: string + openAt: + type: string + price: + type: integer + status: + type: string + surroundings: + $ref: '#/definitions/schema.Surroundings' + title: + type: string + updatedAt: + type: string + videos: + items: + type: string + type: array + watchAvatars: + items: + type: string + type: array + watchNum: + type: integer + type: object + schema.HouseArticle: + properties: + content: + type: string + cover: + type: string + createdAt: + type: string + createdId: + type: integer + deletedAt: + type: integer + deletedId: + type: integer + houseId: + type: integer + id: + type: integer + name: + type: string + pushAt: + type: string + status: + type: string + title: + type: string + updatedAt: + type: string + type: object + schema.HouseArticleForm: + properties: + content: + type: string + cover: + type: string + houseId: + type: integer + name: + type: string + pushAt: + type: string + status: + type: string + title: + type: string + type: object + schema.HouseForm: + properties: + address: + type: string + advisers: + items: + $ref: '#/definitions/schema.Adviser' + type: array + area: + type: number + areaId: + type: integer + cover: + type: string + detail: + $ref: '#/definitions/schema.Detail' + images: + items: + type: string + type: array + labels: + items: + type: string + type: array + latitude: + type: number + layOuts: + items: + $ref: '#/definitions/schema.LayOut' + type: array + longitude: + type: number + masterType: + type: string + name: + type: string + openAt: + type: string + price: + type: integer + status: + type: string + surroundings: + $ref: '#/definitions/schema.Surroundings' + title: + type: string + videos: + items: + type: string + type: array + watchAvatars: + items: + type: string + type: array + watchNum: + type: integer + type: object + schema.LayOut: + properties: + area: + type: number + direction: + type: string + img: + type: string + labels: + items: + type: string + type: array + price: + type: string + title: + type: string + type: object schema.Logger: properties: created_at: @@ -1034,6 +1281,80 @@ definitions: description: Update time type: string type: object + schema.SMSLog: + properties: + SMSContent: + description: 短信内容 + type: string + createdAt: + type: string + createdId: + type: integer + customerName: + description: 客户姓名 + type: string + deletedAt: + type: integer + deletedId: + type: integer + id: + type: integer + phone: + description: 手机号 + type: string + sendAt: + description: 发送时间 + type: string + smsType: + description: /短信类型 + type: string + updatedAt: + type: string + type: object + schema.SMSLogForm: + properties: + SMSContent: + description: 短信内容 + type: string + customerName: + description: 客户姓名 + type: string + phone: + description: 手机号 + type: string + sendAt: + description: 发送时间 + type: string + smsType: + description: /短信类型 + type: string + type: object + schema.SalesInfo: + properties: + duration: + type: string + salesAddress: + type: string + salesPhone: + type: string + salesType: + type: string + status: + type: string + type: object + schema.Surroundings: + properties: + busNum: + type: integer + hospitalNum: + type: integer + lifeNum: + type: integer + metroNum: + type: integer + schoolNum: + type: integer + type: object schema.UpdateCurrentUser: properties: email: @@ -1563,6 +1884,26 @@ paths: summary: 小程序绑定手机号 tags: - APP端 + /api/v1/apps/home: + post: + responses: + "200": + description: OK + schema: + $ref: '#/definitions/util.ResponseResult' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: 首页接口 + tags: + - APP端 /api/v1/apps/login: post: responses: @@ -1583,6 +1924,26 @@ paths: summary: 小程序登陆 tags: - APP端 + /api/v1/apps/mine: + post: + responses: + "200": + description: OK + schema: + $ref: '#/definitions/util.ResponseResult' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: 首页接口 + tags: + - APP端 /api/v1/apps/sms/{phone}: get: responses: @@ -2958,6 +3319,338 @@ paths: summary: Update grade record by ID tags: - 权益模块 + /api/v1/house_articles: + get: + parameters: + - default: 1 + description: pagination index + in: query + name: current + required: true + type: integer + - default: 10 + description: pagination size + in: query + name: pageSize + required: true + type: integer + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/util.ResponseResult' + - properties: + data: + items: + $ref: '#/definitions/schema.HouseArticle' + type: array + type: object + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Query house list + tags: + - 房刊模块 + post: + parameters: + - description: Request body + in: body + name: body + required: true + schema: + $ref: '#/definitions/schema.HouseArticleForm' + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/util.ResponseResult' + - properties: + data: + $ref: '#/definitions/schema.HouseArticle' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/util.ResponseResult' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Create house record + tags: + - 房刊模块 + /api/v1/house_articles/{id}: + delete: + parameters: + - description: unique id + in: path + name: id + required: true + type: string + responses: + "200": + description: OK + schema: + $ref: '#/definitions/util.ResponseResult' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Delete house record by ID + tags: + - 房刊模块 + get: + parameters: + - description: unique id + in: path + name: id + required: true + type: string + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/util.ResponseResult' + - properties: + data: + $ref: '#/definitions/schema.HouseArticle' + type: object + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Get house record by ID + tags: + - 房刊模块 + put: + parameters: + - description: unique id + in: path + name: id + required: true + type: string + - description: Request body + in: body + name: body + required: true + schema: + $ref: '#/definitions/schema.HouseArticleForm' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/util.ResponseResult' + "400": + description: Bad Request + schema: + $ref: '#/definitions/util.ResponseResult' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Update house record by ID + tags: + - 房刊模块 + /api/v1/houses: + get: + parameters: + - default: 1 + description: pagination index + in: query + name: current + required: true + type: integer + - default: 10 + description: pagination size + in: query + name: pageSize + required: true + type: integer + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/util.ResponseResult' + - properties: + data: + items: + $ref: '#/definitions/schema.House' + type: array + type: object + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Query house list + tags: + - 房源模块 + post: + parameters: + - description: Request body + in: body + name: body + required: true + schema: + $ref: '#/definitions/schema.HouseForm' + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/util.ResponseResult' + - properties: + data: + $ref: '#/definitions/schema.House' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/util.ResponseResult' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Create house record + tags: + - 房源模块 + /api/v1/houses/{id}: + delete: + parameters: + - description: unique id + in: path + name: id + required: true + type: string + responses: + "200": + description: OK + schema: + $ref: '#/definitions/util.ResponseResult' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Delete house record by ID + tags: + - 房源模块 + get: + parameters: + - description: unique id + in: path + name: id + required: true + type: string + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/util.ResponseResult' + - properties: + data: + $ref: '#/definitions/schema.House' + type: object + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Get house record by ID + tags: + - 房源模块 + put: + parameters: + - description: unique id + in: path + name: id + required: true + type: string + - description: Request body + in: body + name: body + required: true + schema: + $ref: '#/definitions/schema.HouseForm' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/util.ResponseResult' + "400": + description: Bad Request + schema: + $ref: '#/definitions/util.ResponseResult' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Update house record by ID + tags: + - 房源模块 /api/v1/loggers: get: parameters: @@ -4562,6 +5255,7 @@ paths: - properties: data: items: + format: int32 type: integer type: array type: object @@ -4752,6 +5446,137 @@ paths: summary: Update role record by ID tags: - RoleAPI + /api/v1/smsLogs: + get: + parameters: + - default: 1 + description: pagination index + in: query + name: current + required: true + type: integer + - default: 10 + description: pagination size + in: query + name: pageSize + required: true + type: integer + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/util.ResponseResult' + - properties: + data: + items: + $ref: '#/definitions/schema.SMSLog' + type: array + type: object + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Query smsLog list + tags: + - 短信日志模块 + /api/v1/smsLogs/{id}: + delete: + parameters: + - description: unique id + in: path + name: id + required: true + type: string + responses: + "200": + description: OK + schema: + $ref: '#/definitions/util.ResponseResult' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Delete smsLog record by ID + tags: + - 短信日志模块 + get: + parameters: + - description: unique id + in: path + name: id + required: true + type: string + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/util.ResponseResult' + - properties: + data: + $ref: '#/definitions/schema.SMSLog' + type: object + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Get smsLog record by ID + tags: + - 短信日志模块 + put: + parameters: + - description: unique id + in: path + name: id + required: true + type: string + - description: Request body + in: body + name: body + required: true + schema: + $ref: '#/definitions/schema.SMSLogForm' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/util.ResponseResult' + "400": + description: Bad Request + schema: + $ref: '#/definitions/util.ResponseResult' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/util.ResponseResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/util.ResponseResult' + security: + - ApiKeyAuth: [] + summary: Update smsLog record by ID + tags: + - 短信日志模块 /api/v1/users: get: parameters: diff --git a/internal/wirex/wire_gen.go b/internal/wirex/wire_gen.go index 16968cc..13ff250 100644 --- a/internal/wirex/wire_gen.go +++ b/internal/wirex/wire_gen.go @@ -108,11 +108,15 @@ func BuildInjector(ctx context.Context) (*Injector, func(), error) { apiUser := &api.User{ UserBIZ: bizUser, } + dalCustomer := &dal2.Customer{ + DB: db, + } login := &biz.Login{ Cache: cacher, Auth: auther, UserDAL: user, UserRoleDAL: userRole, + CustomerDAL: dalCustomer, MenuDAL: menu, UserBIZ: bizUser, } @@ -143,9 +147,6 @@ func BuildInjector(ctx context.Context) (*Injector, func(), error) { LoggerAPI: apiLogger, Casbinx: casbinx, } - dalCustomer := &dal2.Customer{ - DB: db, - } bizCustomer := &biz2.Customer{ Cache: cacher, Trans: trans, @@ -231,6 +232,13 @@ func BuildInjector(ctx context.Context) (*Injector, func(), error) { apiArea := &api3.Area{ AreaBIZ: bizArea, } + upload := &biz3.Upload{ + Cache: cacher, + Trans: trans, + } + apiUpload := &api3.Upload{ + UploadBIZ: upload, + } receptionCenter := &dal3.ReceptionCenter{ DB: db, } @@ -241,6 +249,16 @@ func BuildInjector(ctx context.Context) (*Injector, func(), error) { apiReceptionCenter := &api3.ReceptionCenter{ ReceptionCenterBIZ: bizReceptionCenter, } + smsLog := &dal3.SMSLog{ + DB: db, + } + bizSMSLog := &biz3.SMSLog{ + Trans: trans, + SMSLogDAL: smsLog, + } + apiSMSLog := &api3.SMSLog{ + SMSLogBIZ: bizSMSLog, + } commonCommon := &common.Common{ DB: db, CommonAPI: apiCommon, @@ -248,7 +266,9 @@ func BuildInjector(ctx context.Context) (*Injector, func(), error) { NoticeAPI: apiNotice, CompanyAPI: apiCompany, AreaAPI: apiArea, + UploadAPI: apiUpload, ReceptionCenterAPI: apiReceptionCenter, + SMSLogAPI: apiSMSLog, } dalProduct := &dal4.Product{ DB: db,