mirror of https://github.com/zhufuyi/sponge
docs: update api document
This commit is contained in:
parent
25d80d2704
commit
e08b23718f
|
@ -23,7 +23,7 @@
|
|||
"paths": {
|
||||
"/api/v1/userExample": {
|
||||
"post": {
|
||||
"summary": "create a new userExample",
|
||||
"summary": "Create a new userExample",
|
||||
"description": "Creates a new userExample entity using the provided data in the request body.",
|
||||
"operationId": "userExample_Create",
|
||||
"responses": {
|
||||
|
@ -91,7 +91,7 @@
|
|||
},
|
||||
"/api/v1/userExample/{id}": {
|
||||
"get": {
|
||||
"summary": "get userExample details by id",
|
||||
"summary": "Get a userExample by id",
|
||||
"description": "Gets detailed information of a userExample specified by the given id in the path.",
|
||||
"operationId": "userExample_GetByID",
|
||||
"responses": {
|
||||
|
@ -122,7 +122,7 @@
|
|||
]
|
||||
},
|
||||
"delete": {
|
||||
"summary": "delete a userExample by id",
|
||||
"summary": "Delete a userExample by id",
|
||||
"description": "Deletes a existing userExample identified by the given id in the path.",
|
||||
"operationId": "userExample_DeleteByID",
|
||||
"responses": {
|
||||
|
@ -153,7 +153,7 @@
|
|||
]
|
||||
},
|
||||
"put": {
|
||||
"summary": "update a userExample by id",
|
||||
"summary": "Update a userExample by id",
|
||||
"description": "Updates the specified userExample with new data provided in the request body. The target is identified by id in the path.",
|
||||
"operationId": "userExample_UpdateByID",
|
||||
"responses": {
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
"tags": [
|
||||
"userExample"
|
||||
],
|
||||
"summary": "create a new userExample",
|
||||
"summary": "Create a new userExample",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "userExample information",
|
||||
|
@ -68,7 +68,7 @@
|
|||
"tags": [
|
||||
"userExample"
|
||||
],
|
||||
"summary": "get a list of userExample by custom conditions",
|
||||
"summary": "Get a paginated list of userExamples by custom conditions",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "query parameters",
|
||||
|
@ -107,7 +107,7 @@
|
|||
"tags": [
|
||||
"userExample"
|
||||
],
|
||||
"summary": "get userExample details by id",
|
||||
"summary": "Get a userExample by id",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
|
@ -142,7 +142,7 @@
|
|||
"tags": [
|
||||
"userExample"
|
||||
],
|
||||
"summary": "update a userExample by id",
|
||||
"summary": "Update a userExample by id",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
|
@ -186,7 +186,7 @@
|
|||
"tags": [
|
||||
"userExample"
|
||||
],
|
||||
"summary": "delete a userExample by id",
|
||||
"summary": "Delete a userExample by id",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
|
|
|
@ -237,7 +237,7 @@ paths:
|
|||
$ref: '#/definitions/types.CreateUserExampleReply'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: create a new userExample
|
||||
summary: Create a new userExample
|
||||
tags:
|
||||
- userExample
|
||||
/api/v1/userExample/{id}:
|
||||
|
@ -261,7 +261,7 @@ paths:
|
|||
$ref: '#/definitions/types.DeleteUserExampleByIDReply'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: delete a userExample by id
|
||||
summary: Delete a userExample by id
|
||||
tags:
|
||||
- userExample
|
||||
get:
|
||||
|
@ -284,7 +284,7 @@ paths:
|
|||
$ref: '#/definitions/types.GetUserExampleByIDReply'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: get userExample details by id
|
||||
summary: Get a userExample by id
|
||||
tags:
|
||||
- userExample
|
||||
put:
|
||||
|
@ -313,7 +313,7 @@ paths:
|
|||
$ref: '#/definitions/types.UpdateUserExampleByIDReply'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: update a userExample by id
|
||||
summary: Update a userExample by id
|
||||
tags:
|
||||
- userExample
|
||||
/api/v1/userExample/list:
|
||||
|
@ -338,7 +338,7 @@ paths:
|
|||
$ref: '#/definitions/types.ListUserExamplesReply'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: get a list of userExample by custom conditions
|
||||
summary: Get a paginated list of userExamples by custom conditions
|
||||
tags:
|
||||
- userExample
|
||||
/codes:
|
||||
|
|
|
@ -121,7 +121,7 @@ func (d *userExampleDao) updateDataByID(ctx context.Context, db *gorm.DB, table
|
|||
return db.WithContext(ctx).Model(table).Updates(update).Error
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (d *userExampleDao) GetByID(ctx context.Context, id uint64) (*model.UserExample, error) {
|
||||
// no cache
|
||||
if d.cache == nil {
|
||||
|
@ -175,7 +175,7 @@ func (d *userExampleDao) GetByID(ctx context.Context, id uint64) (*model.UserExa
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// GetByColumns get a list of userExample by custom conditions.
|
||||
// GetByColumns get a paginated list of userExamples by custom conditions.
|
||||
// For more details, please refer to https://go-sponge.com/component/custom-page-query.html
|
||||
func (d *userExampleDao) GetByColumns(ctx context.Context, params *query.Params) ([]*model.UserExample, int64, error) {
|
||||
queryStr, args, err := params.ConvertToGormConditions(query.WithWhitelistNames(model.UserExampleColumnNames))
|
||||
|
|
|
@ -127,7 +127,7 @@ func (d *userExampleDao) updateDataByID(ctx context.Context, db *gorm.DB, table
|
|||
return db.WithContext(ctx).Model(table).Updates(update).Error
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (d *userExampleDao) GetByID(ctx context.Context, id uint64) (*model.UserExample, error) {
|
||||
// no cache
|
||||
if d.cache == nil {
|
||||
|
@ -181,7 +181,7 @@ func (d *userExampleDao) GetByID(ctx context.Context, id uint64) (*model.UserExa
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// GetByColumns get a list of userExample by custom conditions.
|
||||
// GetByColumns get a paginated list of userExamples by custom conditions.
|
||||
// For more details, please refer to https://go-sponge.com/component/custom-page-query.html
|
||||
func (d *userExampleDao) GetByColumns(ctx context.Context, params *query.Params) ([]*model.UserExample, int64, error) {
|
||||
queryStr, args, err := params.ConvertToGormConditions(query.WithWhitelistNames(model.UserExampleColumnNames))
|
||||
|
@ -210,7 +210,7 @@ func (d *userExampleDao) GetByColumns(ctx context.Context, params *query.Params)
|
|||
return records, total, err
|
||||
}
|
||||
|
||||
// DeleteByIDs delete userExample by batch id
|
||||
// DeleteByIDs batch delete userExample by ids
|
||||
func (d *userExampleDao) DeleteByIDs(ctx context.Context, ids []uint64) error {
|
||||
err := d.db.WithContext(ctx).Where("id IN (?)", ids).Delete(&model.UserExample{}).Error
|
||||
if err != nil {
|
||||
|
@ -225,7 +225,7 @@ func (d *userExampleDao) DeleteByIDs(ctx context.Context, ids []uint64) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// GetByCondition get userExample details by custom condition
|
||||
// GetByCondition get a userExample by custom condition
|
||||
// For more details, please refer to https://go-sponge.com/component/custom-page-query.html#_2-condition-parameters-optional
|
||||
func (d *userExampleDao) GetByCondition(ctx context.Context, c *query.Conditions) (*model.UserExample, error) {
|
||||
queryStr, args, err := c.ConvertToGorm(query.WithWhitelistNames(model.UserExampleColumnNames))
|
||||
|
@ -242,7 +242,7 @@ func (d *userExampleDao) GetByCondition(ctx context.Context, c *query.Conditions
|
|||
return table, nil
|
||||
}
|
||||
|
||||
// GetByIDs get a list of userExample by batch id
|
||||
// GetByIDs Batch get userExample by ids
|
||||
func (d *userExampleDao) GetByIDs(ctx context.Context, ids []uint64) (map[uint64]*model.UserExample, error) {
|
||||
// no cache
|
||||
if d.cache == nil {
|
||||
|
@ -316,7 +316,7 @@ func (d *userExampleDao) GetByIDs(ctx context.Context, ids []uint64) (map[uint64
|
|||
return itemMap, nil
|
||||
}
|
||||
|
||||
// GetByLastID get a list of userExample by last id
|
||||
// GetByLastID Get a paginated list of userExamples by last id
|
||||
func (d *userExampleDao) GetByLastID(ctx context.Context, lastID uint64, limit int, sort string) ([]*model.UserExample, error) {
|
||||
page := query.NewPage(0, limit, sort)
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ func (d *{{.TableNameCamelFCL}}Dao) updateDataBy{{.ColumnNameCamel}}(ctx context
|
|||
return db.WithContext(ctx).Model(table).Updates(update).Error
|
||||
}
|
||||
|
||||
// GetBy{{.ColumnNameCamel}} get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// GetBy{{.ColumnNameCamel}} get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
func (d *{{.TableNameCamelFCL}}Dao) GetBy{{.ColumnNameCamel}}(ctx context.Context, {{.ColumnNameCamelFCL}} {{.GoType}}) (*model.{{.TableNameCamel}}, error) {
|
||||
// no cache
|
||||
if d.cache == nil {
|
||||
|
@ -187,7 +187,7 @@ func (d *{{.TableNameCamelFCL}}Dao) GetBy{{.ColumnNameCamel}}(ctx context.Contex
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// GetByColumns get a list of {{.TableNameCamelFCL}} by custom conditions.
|
||||
// GetByColumns get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions.
|
||||
// For more details, please refer to https://go-sponge.com/component/custom-page-query.html
|
||||
func (d *{{.TableNameCamelFCL}}Dao) GetByColumns(ctx context.Context, params *query.Params) ([]*model.{{.TableNameCamel}}, int64, error) {
|
||||
if params.Sort == "" {
|
||||
|
@ -219,7 +219,7 @@ func (d *{{.TableNameCamelFCL}}Dao) GetByColumns(ctx context.Context, params *qu
|
|||
return records, total, err
|
||||
}
|
||||
|
||||
// DeleteBy{{.ColumnNamePluralCamel}} delete {{.TableNameCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// DeleteBy{{.ColumnNamePluralCamel}} batch delete {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
func (d *{{.TableNameCamelFCL}}Dao) DeleteBy{{.ColumnNamePluralCamel}}(ctx context.Context, {{.ColumnNamePluralCamelFCL}} []{{.GoType}}) error {
|
||||
err := d.db.WithContext(ctx).Where("{{.ColumnName}} IN (?)", {{.ColumnNamePluralCamelFCL}}).Delete(&model.{{.TableNameCamel}}{}).Error
|
||||
if err != nil {
|
||||
|
@ -234,7 +234,7 @@ func (d *{{.TableNameCamelFCL}}Dao) DeleteBy{{.ColumnNamePluralCamel}}(ctx conte
|
|||
return nil
|
||||
}
|
||||
|
||||
// GetByCondition get {{.TableNameCamelFCL}} details by custom condition
|
||||
// GetByCondition get a {{.TableNameCamelFCL}} by custom condition
|
||||
// For more details, please refer to https://go-sponge.com/component/custom-page-query.html#_2-condition-parameters-optional
|
||||
func (d *{{.TableNameCamelFCL}}Dao) GetByCondition(ctx context.Context, c *query.Conditions) (*model.{{.TableNameCamel}}, error) {
|
||||
queryStr, args, err := c.ConvertToGorm(query.WithWhitelistNames(model.{{.TableNameCamel}}ColumnNames))
|
||||
|
@ -251,7 +251,7 @@ func (d *{{.TableNameCamelFCL}}Dao) GetByCondition(ctx context.Context, c *query
|
|||
return table, nil
|
||||
}
|
||||
|
||||
// GetBy{{.ColumnNamePluralCamel}} get a list of {{.TableNameCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// GetBy{{.ColumnNamePluralCamel}} batch get {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
func (d *{{.TableNameCamelFCL}}Dao) GetBy{{.ColumnNamePluralCamel}}(ctx context.Context, {{.ColumnNamePluralCamelFCL}} []{{.GoType}}) (map[{{.GoType}}]*model.{{.TableNameCamel}}, error) {
|
||||
// no cache
|
||||
if d.cache == nil {
|
||||
|
@ -326,7 +326,7 @@ func (d *{{.TableNameCamelFCL}}Dao) GetBy{{.ColumnNamePluralCamel}}(ctx context.
|
|||
return itemMap, nil
|
||||
}
|
||||
|
||||
// GetByLast{{.ColumnNameCamel}} get a list of {{.TableNameCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
// GetByLast{{.ColumnNameCamel}} get a paginated list of {{.TableNamePluralCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
func (d *{{.TableNameCamelFCL}}Dao) GetByLast{{.ColumnNameCamel}}(ctx context.Context, last{{.ColumnNameCamel}} {{.GoType}}, limit int, sort string) ([]*model.{{.TableNameCamel}}, error) {
|
||||
if sort == "" {
|
||||
sort = "-{{.ColumnName}}"
|
||||
|
|
|
@ -134,7 +134,7 @@ func (d *userExampleDao) updateDataByID(ctx context.Context, collection *mongo.C
|
|||
return err
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (d *userExampleDao) GetByID(ctx context.Context, id string) (*model.UserExample, error) {
|
||||
oid := database.ToObjectID(id)
|
||||
if oid.IsZero() {
|
||||
|
@ -193,15 +193,17 @@ func (d *userExampleDao) GetByID(ctx context.Context, id string) (*model.UserExa
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// GetByColumns get a list of userExample by custom conditions.
|
||||
// GetByColumns get a paginated list of userExamples by custom conditions.
|
||||
// For more details, please refer to https://go-sponge.com/component/custom-page-query.html
|
||||
func (d *userExampleDao) GetByColumns(ctx context.Context, params *query.Params) ([]*model.UserExample, int64, error) {
|
||||
filter, err := params.ConvertToMongoFilter(query.WithWhitelistNames(model.UserExampleColumnNames))
|
||||
if err != nil {
|
||||
return nil, 0, errors.New("query params error: " + err.Error())
|
||||
}
|
||||
filter = mgo.ExcludeDeleted(filter)
|
||||
logger.Info("query filter", logger.Any("filter", filter))
|
||||
|
||||
total, err := d.collection.CountDocuments(ctx, mgo.ExcludeDeleted(filter))
|
||||
total, err := d.collection.CountDocuments(ctx, filter)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
@ -215,7 +217,7 @@ func (d *userExampleDao) GetByColumns(ctx context.Context, params *query.Params)
|
|||
findOpts.SetLimit(int64(limit)).SetSkip(int64(skip))
|
||||
findOpts.Sort = sort
|
||||
|
||||
cursor, err := d.collection.Find(ctx, mgo.ExcludeDeleted(filter), findOpts)
|
||||
cursor, err := d.collection.Find(ctx, filter, findOpts)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ func (d *userExampleDao) updateDataByID(ctx context.Context, collection *mongo.C
|
|||
return err
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (d *userExampleDao) GetByID(ctx context.Context, id string) (*model.UserExample, error) {
|
||||
oid := database.ToObjectID(id)
|
||||
if oid.IsZero() {
|
||||
|
@ -198,15 +198,17 @@ func (d *userExampleDao) GetByID(ctx context.Context, id string) (*model.UserExa
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// GetByColumns get a list of userExample by custom conditions.
|
||||
// GetByColumns get a paginated list of userExamples by custom conditions.
|
||||
// For more details, please refer to https://go-sponge.com/component/custom-page-query.html
|
||||
func (d *userExampleDao) GetByColumns(ctx context.Context, params *query.Params) ([]*model.UserExample, int64, error) {
|
||||
filter, err := params.ConvertToMongoFilter(query.WithWhitelistNames(model.UserExampleColumnNames))
|
||||
if err != nil {
|
||||
return nil, 0, errors.New("query params error: " + err.Error())
|
||||
}
|
||||
filter = mgo.ExcludeDeleted(filter)
|
||||
logger.Info("query filter", logger.Any("filter", filter))
|
||||
|
||||
total, err := d.collection.CountDocuments(ctx, mgo.ExcludeDeleted(filter))
|
||||
total, err := d.collection.CountDocuments(ctx, filter)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
@ -220,7 +222,7 @@ func (d *userExampleDao) GetByColumns(ctx context.Context, params *query.Params)
|
|||
findOpts.SetLimit(int64(limit)).SetSkip(int64(skip))
|
||||
findOpts.Sort = sort
|
||||
|
||||
cursor, err := d.collection.Find(ctx, mgo.ExcludeDeleted(filter), findOpts)
|
||||
cursor, err := d.collection.Find(ctx, filter, findOpts)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
@ -232,7 +234,7 @@ func (d *userExampleDao) GetByColumns(ctx context.Context, params *query.Params)
|
|||
return records, total, err
|
||||
}
|
||||
|
||||
// DeleteByIDs delete userExample by batch id
|
||||
// DeleteByIDs batch delete userExample by ids
|
||||
func (d *userExampleDao) DeleteByIDs(ctx context.Context, ids []string) error {
|
||||
oids := mgo.ConvertToObjectIDs(ids)
|
||||
filter := bson.M{"_id": bson.M{"$in": oids}}
|
||||
|
@ -249,16 +251,18 @@ func (d *userExampleDao) DeleteByIDs(ctx context.Context, ids []string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// GetByCondition get userExample details by custom condition.
|
||||
// GetByCondition get a userExample by custom condition.
|
||||
// For more details, please refer to https://go-sponge.com/component/custom-page-query.html#_2-condition-parameters-optional
|
||||
func (d *userExampleDao) GetByCondition(ctx context.Context, c *query.Conditions) (*model.UserExample, error) {
|
||||
filter, err := c.ConvertToMongo(query.WithWhitelistNames(model.UserExampleColumnNames))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
filter = mgo.ExcludeDeleted(filter)
|
||||
logger.Info("query filter", logger.Any("filter", filter))
|
||||
|
||||
record := &model.UserExample{}
|
||||
err = d.collection.FindOne(ctx, mgo.ExcludeDeleted(filter)).Decode(record)
|
||||
err = d.collection.FindOne(ctx, filter).Decode(record)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -266,7 +270,7 @@ func (d *userExampleDao) GetByCondition(ctx context.Context, c *query.Conditions
|
|||
return record, nil
|
||||
}
|
||||
|
||||
// GetByIDs get a list of userExample by batch id
|
||||
// GetByIDs Batch get userExample by ids
|
||||
func (d *userExampleDao) GetByIDs(ctx context.Context, ids []string) (map[string]*model.UserExample, error) {
|
||||
// no cache
|
||||
if d.cache == nil {
|
||||
|
@ -352,7 +356,7 @@ func (d *userExampleDao) GetByIDs(ctx context.Context, ids []string) (map[string
|
|||
return itemMap, nil
|
||||
}
|
||||
|
||||
// GetByLastID get a list of userExample by last id
|
||||
// GetByLastID Get a paginated list of userExamples by last id
|
||||
func (d *userExampleDao) GetByLastID(ctx context.Context, lastID string, limit int, sort string) ([]*model.UserExample, error) {
|
||||
page := query.NewPage(0, limit, sort)
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ func (d *{{.TableNameCamelFCL}}Dao) updateDataBy{{.ColumnNameCamel}}(ctx context
|
|||
return db.WithContext(ctx).Model(table).Updates(update).Error
|
||||
}
|
||||
|
||||
// GetBy{{.ColumnNameCamel}} get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// GetBy{{.ColumnNameCamel}} get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
func (d *{{.TableNameCamelFCL}}Dao) GetBy{{.ColumnNameCamel}}(ctx context.Context, {{.ColumnNameCamelFCL}} {{.GoType}}) (*model.{{.TableNameCamel}}, error) {
|
||||
// no cache
|
||||
if d.cache == nil {
|
||||
|
@ -181,7 +181,7 @@ func (d *{{.TableNameCamelFCL}}Dao) GetBy{{.ColumnNameCamel}}(ctx context.Contex
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// GetByColumns get a list of {{.TableNameCamelFCL}} by custom conditions.
|
||||
// GetByColumns get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions.
|
||||
// For more details, please refer to https://go-sponge.com/component/custom-page-query.html
|
||||
func (d *{{.TableNameCamelFCL}}Dao) GetByColumns(ctx context.Context, params *query.Params) ([]*model.{{.TableNameCamel}}, int64, error) {
|
||||
if params.Sort == "" {
|
||||
|
|
|
@ -45,7 +45,7 @@ func NewUserExampleHandler() UserExampleHandler {
|
|||
}
|
||||
|
||||
// Create a new userExample
|
||||
// @Summary create a new userExample
|
||||
// @Summary Create a new userExample
|
||||
// @Description Creates a new userExample entity using the provided data in the request body.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -83,7 +83,7 @@ func (h *userExampleHandler) Create(c *gin.Context) {
|
|||
}
|
||||
|
||||
// DeleteByID delete a userExample by id
|
||||
// @Summary delete a userExample by id
|
||||
// @Summary Delete a userExample by id
|
||||
// @Description Deletes a existing userExample identified by the given id in the path.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -111,7 +111,7 @@ func (h *userExampleHandler) DeleteByID(c *gin.Context) {
|
|||
}
|
||||
|
||||
// UpdateByID update a userExample by id
|
||||
// @Summary update a userExample by id
|
||||
// @Summary Update a userExample by id
|
||||
// @Description Updates the specified userExample by given id in the path, support partial update.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -156,8 +156,8 @@ func (h *userExampleHandler) UpdateByID(c *gin.Context) {
|
|||
response.Success(c)
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// @Summary get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
// @Summary Get a userExample by id
|
||||
// @Description Gets detailed information of a userExample specified by the given id in the path.
|
||||
// @Tags userExample
|
||||
// @Param id path string true "id"
|
||||
|
@ -197,8 +197,8 @@ func (h *userExampleHandler) GetByID(c *gin.Context) {
|
|||
response.Success(c, gin.H{"userExample": data})
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// @Summary get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
// @Summary Get a paginated list of userExamples by custom conditions
|
||||
// @Description Returns a paginated list of userExample based on query filters, including page number and size.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
|
|
@ -51,7 +51,7 @@ func NewUserExampleHandler() UserExampleHandler {
|
|||
}
|
||||
|
||||
// Create a new userExample
|
||||
// @Summary create a new userExample
|
||||
// @Summary Create a new userExample
|
||||
// @Description Creates a new userExample entity using the provided data in the request body.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -89,7 +89,7 @@ func (h *userExampleHandler) Create(c *gin.Context) {
|
|||
}
|
||||
|
||||
// DeleteByID delete a userExample by id
|
||||
// @Summary delete a userExample by id
|
||||
// @Summary Delete a userExample by id
|
||||
// @Description Deletes a existing userExample identified by the given id in the path.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -117,7 +117,7 @@ func (h *userExampleHandler) DeleteByID(c *gin.Context) {
|
|||
}
|
||||
|
||||
// UpdateByID update a userExample by id
|
||||
// @Summary update a userExample by id
|
||||
// @Summary Update a userExample by id
|
||||
// @Description Updates the specified userExample by given id in the path, support partial update.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -162,8 +162,8 @@ func (h *userExampleHandler) UpdateByID(c *gin.Context) {
|
|||
response.Success(c)
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// @Summary get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
// @Summary Get a userExample by id
|
||||
// @Description Gets detailed information of a userExample specified by the given id in the path.
|
||||
// @Tags userExample
|
||||
// @Param id path string true "id"
|
||||
|
@ -203,8 +203,8 @@ func (h *userExampleHandler) GetByID(c *gin.Context) {
|
|||
response.Success(c, gin.H{"userExample": data})
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// @Summary get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
// @Summary Get a paginated list of userExamples by custom conditions
|
||||
// @Description Returns a paginated list of userExample based on query filters, including page number and size.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -242,8 +242,8 @@ func (h *userExampleHandler) List(c *gin.Context) {
|
|||
})
|
||||
}
|
||||
|
||||
// DeleteByIDs delete userExample by batch id
|
||||
// @Summary delete userExample by batch id
|
||||
// DeleteByIDs batch delete userExample by ids
|
||||
// @Summary Batch delete userExample by ids
|
||||
// @Description Deletes multiple userExample by a list of id
|
||||
// @Tags userExample
|
||||
// @Param data body types.DeleteUserExamplesByIDsRequest true "id array"
|
||||
|
@ -272,8 +272,8 @@ func (h *userExampleHandler) DeleteByIDs(c *gin.Context) {
|
|||
response.Success(c)
|
||||
}
|
||||
|
||||
// GetByCondition get userExample details by custom condition
|
||||
// @Summary get userExample details by custom condition
|
||||
// GetByCondition get a userExample by custom condition
|
||||
// @Summary Get a userExample by custom condition
|
||||
// @Description Returns a single userExample that matches the specified filter conditions.
|
||||
// @Tags userExample
|
||||
// @Param data body types.Conditions true "query condition"
|
||||
|
@ -321,8 +321,8 @@ func (h *userExampleHandler) GetByCondition(c *gin.Context) {
|
|||
response.Success(c, gin.H{"userExample": data})
|
||||
}
|
||||
|
||||
// ListByIDs get a list of userExample by batch id
|
||||
// @Summary get a list of userExample by batch id
|
||||
// ListByIDs batch get userExample by ids
|
||||
// @Summary Batch get userExample by ids
|
||||
// @Description Returns a list of userExample that match the list of id.
|
||||
// @Tags userExample
|
||||
// @Param data body types.ListUserExamplesByIDsRequest true "id array"
|
||||
|
@ -365,8 +365,8 @@ func (h *userExampleHandler) ListByIDs(c *gin.Context) {
|
|||
})
|
||||
}
|
||||
|
||||
// ListByLastID get a list of userExample by last id
|
||||
// @Summary get a list of userExample by last id
|
||||
// ListByLastID get a paginated list of userExamples by last id
|
||||
// @Summary Get a paginated list of userExamples by last id
|
||||
// @Description Returns a paginated list of userExamples starting after a given last id, useful for cursor-based pagination.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
|
|
@ -51,7 +51,7 @@ func New{{.TableNameCamel}}Handler() {{.TableNameCamel}}Handler {
|
|||
}
|
||||
|
||||
// Create a new {{.TableNameCamelFCL}}
|
||||
// @Summary create a new {{.TableNameCamelFCL}}
|
||||
// @Summary Create a new {{.TableNameCamelFCL}}
|
||||
// @Description Creates a new {{.TableNameCamelFCL}} entity using the provided data in the request body.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Accept json
|
||||
|
@ -89,7 +89,7 @@ func (h *{{.TableNameCamelFCL}}Handler) Create(c *gin.Context) {
|
|||
}
|
||||
|
||||
// DeleteBy{{.ColumnNameCamel}} delete a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Summary delete a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Summary Delete a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Description Deletes a existing {{.TableNameCamelFCL}} identified by the given {{.ColumnNameCamelFCL}} in the path.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Accept json
|
||||
|
@ -117,7 +117,7 @@ func (h *{{.TableNameCamelFCL}}Handler) DeleteBy{{.ColumnNameCamel}}(c *gin.Cont
|
|||
}
|
||||
|
||||
// UpdateBy{{.ColumnNameCamel}} update a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Summary update a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Summary Update a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Description Updates the specified {{.TableNameCamelFCL}} by given {{.ColumnNameCamelFCL}} in the path, support partial update.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Accept json
|
||||
|
@ -162,8 +162,8 @@ func (h *{{.TableNameCamelFCL}}Handler) UpdateBy{{.ColumnNameCamel}}(c *gin.Cont
|
|||
response.Success(c)
|
||||
}
|
||||
|
||||
// GetBy{{.ColumnNameCamel}} get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// @Summary get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// GetBy{{.ColumnNameCamel}} get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Summary Get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Description Gets detailed information of a {{.TableNameCamelFCL}} specified by the given {{.ColumnNameCamelFCL}} in the path.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Param {{.ColumnNameCamelFCL}} path string true "{{.ColumnNameCamelFCL}}"
|
||||
|
@ -203,8 +203,8 @@ func (h *{{.TableNameCamelFCL}}Handler) GetBy{{.ColumnNameCamel}}(c *gin.Context
|
|||
response.Success(c, gin.H{"{{.TableNameCamelFCL}}": data})
|
||||
}
|
||||
|
||||
// List get a list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
// @Summary get a list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
// List get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
// @Summary Get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
// @Description Returns a paginated list of {{.TableNamePluralCamelFCL}} based on query filters, including page number and size.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Accept json
|
||||
|
@ -242,8 +242,8 @@ func (h *{{.TableNameCamelFCL}}Handler) List(c *gin.Context) {
|
|||
})
|
||||
}
|
||||
|
||||
// DeleteBy{{.ColumnNamePluralCamel}} delete {{.TableNamePluralCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// @Summary delete {{.TableNamePluralCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// DeleteBy{{.ColumnNamePluralCamel}} batch delete {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
// @Summary Batch delete {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
// @Description Deletes multiple {{.TableNamePluralCamelFCL}} by a list of {{.ColumnNameCamelFCL}}
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Param data body types.Delete{{.TableNamePluralCamel}}By{{.ColumnNamePluralCamel}}Request true "{{.ColumnNameCamelFCL}} array"
|
||||
|
@ -272,8 +272,8 @@ func (h *{{.TableNameCamelFCL}}Handler) DeleteBy{{.ColumnNamePluralCamel}}(c *gi
|
|||
response.Success(c)
|
||||
}
|
||||
|
||||
// GetByCondition get {{.TableNameCamelFCL}} details by custom condition
|
||||
// @Summary get {{.TableNameCamelFCL}} details by custom condition
|
||||
// GetByCondition get a {{.TableNameCamelFCL}} by custom condition
|
||||
// @Summary Get a {{.TableNameCamelFCL}} by custom condition
|
||||
// @Description Returns a single {{.TableNameCamelFCL}} that matches the specified filter conditions.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Param data body types.Conditions true "query condition"
|
||||
|
@ -321,8 +321,8 @@ func (h *{{.TableNameCamelFCL}}Handler) GetByCondition(c *gin.Context) {
|
|||
response.Success(c, gin.H{"{{.TableNameCamelFCL}}": data})
|
||||
}
|
||||
|
||||
// ListBy{{.ColumnNamePluralCamel}} get a list of {{.TableNamePluralCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// @Summary get a list of {{.TableNamePluralCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// ListBy{{.ColumnNamePluralCamel}} batch get {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
// @Summary Batch get {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
// @Description Returns a list of {{.TableNamePluralCamelFCL}} that match the list of {{.ColumnNameCamelFCL}}.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Param data body types.List{{.TableNamePluralCamel}}By{{.ColumnNamePluralCamel}}Request true "{{.ColumnNameCamelFCL}} array"
|
||||
|
@ -365,8 +365,8 @@ func (h *{{.TableNameCamelFCL}}Handler) ListBy{{.ColumnNamePluralCamel}}(c *gin.
|
|||
})
|
||||
}
|
||||
|
||||
// ListByLast{{.ColumnNameCamel}} get a list of {{.TableNamePluralCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
// @Summary get a list of {{.TableNamePluralCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
// ListByLast{{.ColumnNameCamel}} get a paginated list of {{.TableNamePluralCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
// @Summary Get a paginated list of {{.TableNamePluralCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
// @Description Returns a paginated list of {{.TableNamePluralCamelFCL}} starting after a given last {{.ColumnNameCamelFCL}}, useful for cursor-based pagination.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Accept json
|
||||
|
|
|
@ -45,7 +45,7 @@ func NewUserExampleHandler() UserExampleHandler {
|
|||
}
|
||||
|
||||
// Create a new userExample
|
||||
// @Summary create a new userExample
|
||||
// @Summary Create a new userExample
|
||||
// @Description Creates a new userExample entity using the provided data in the request body.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -83,7 +83,7 @@ func (h *userExampleHandler) Create(c *gin.Context) {
|
|||
}
|
||||
|
||||
// DeleteByID delete a userExample by id
|
||||
// @Summary delete a userExample by id
|
||||
// @Summary Delete a userExample by id
|
||||
// @Description Deletes a existing userExample identified by the given id in the path.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -106,7 +106,7 @@ func (h *userExampleHandler) DeleteByID(c *gin.Context) {
|
|||
}
|
||||
|
||||
// UpdateByID update a userExample by id
|
||||
// @Summary update a userExample by id
|
||||
// @Summary Update a userExample by id
|
||||
// @Description Updates the specified userExample by given id in the path, support partial update.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -151,8 +151,8 @@ func (h *userExampleHandler) UpdateByID(c *gin.Context) {
|
|||
response.Success(c)
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// @Summary get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
// @Summary Get a userExample by id
|
||||
// @Description Gets detailed information of a userExample specified by the given id in the path.
|
||||
// @Tags userExample
|
||||
// @Param id path string true "id"
|
||||
|
@ -188,8 +188,8 @@ func (h *userExampleHandler) GetByID(c *gin.Context) {
|
|||
response.Success(c, gin.H{"userExample": data})
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// @Summary get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
// @Summary Get a paginated list of userExamples by custom conditions
|
||||
// @Description Returns a paginated list of userExample based on query filters, including page number and size.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
|
|
@ -51,7 +51,7 @@ func NewUserExampleHandler() UserExampleHandler {
|
|||
}
|
||||
|
||||
// Create a new userExample
|
||||
// @Summary create a new userExample
|
||||
// @Summary Create a new userExample
|
||||
// @Description Creates a new userExample entity using the provided data in the request body.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -89,7 +89,7 @@ func (h *userExampleHandler) Create(c *gin.Context) {
|
|||
}
|
||||
|
||||
// DeleteByID delete a userExample by id
|
||||
// @Summary delete a userExample by id
|
||||
// @Summary Delete a userExample by id
|
||||
// @Description Deletes a existing userExample identified by the given id in the path.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -112,7 +112,7 @@ func (h *userExampleHandler) DeleteByID(c *gin.Context) {
|
|||
}
|
||||
|
||||
// UpdateByID update a userExample by id
|
||||
// @Summary update a userExample by id
|
||||
// @Summary Update a userExample by id
|
||||
// @Description Updates the specified userExample by given id in the path, support partial update.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -157,8 +157,8 @@ func (h *userExampleHandler) UpdateByID(c *gin.Context) {
|
|||
response.Success(c)
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// @Summary get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
// @Summary Get a userExample by id
|
||||
// @Description Gets detailed information of a userExample specified by the given id in the path.
|
||||
// @Tags userExample
|
||||
// @Param id path string true "id"
|
||||
|
@ -194,8 +194,8 @@ func (h *userExampleHandler) GetByID(c *gin.Context) {
|
|||
response.Success(c, gin.H{"userExample": data})
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// @Summary get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
// @Summary Get a paginated list of userExamples by custom conditions
|
||||
// @Description Returns a paginated list of userExample based on query filters, including page number and size.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
@ -233,8 +233,8 @@ func (h *userExampleHandler) List(c *gin.Context) {
|
|||
})
|
||||
}
|
||||
|
||||
// DeleteByIDs delete userExample by batch id
|
||||
// @Summary delete userExample by batch id
|
||||
// DeleteByIDs batch delete userExample by ids
|
||||
// @Summary Batch delete userExample by ids
|
||||
// @Description Deletes multiple userExample by a list of id
|
||||
// @Tags userExample
|
||||
// @Param data body types.DeleteUserExamplesByIDsRequest true "id array"
|
||||
|
@ -263,8 +263,8 @@ func (h *userExampleHandler) DeleteByIDs(c *gin.Context) {
|
|||
response.Success(c)
|
||||
}
|
||||
|
||||
// GetByCondition get userExample details by custom condition
|
||||
// @Summary get userExample details by custom condition
|
||||
// GetByCondition get a userExample by custom condition
|
||||
// @Summary Get a userExample by custom condition
|
||||
// @Description Returns a single userExample that matches the specified filter conditions.
|
||||
// @Tags userExample
|
||||
// @Param data body types.Conditions true "query condition"
|
||||
|
@ -313,8 +313,8 @@ func (h *userExampleHandler) GetByCondition(c *gin.Context) {
|
|||
response.Success(c, gin.H{"userExample": data})
|
||||
}
|
||||
|
||||
// ListByIDs get a list of userExample by batch id
|
||||
// @Summary get a list of userExample by batch id
|
||||
// ListByIDs batch get userExample by ids
|
||||
// @Summary Batch get userExample by ids
|
||||
// @Description Returns a list of userExample that match the list of id.
|
||||
// @Tags userExample
|
||||
// @Param data body types.ListUserExamplesByIDsRequest true "id array"
|
||||
|
@ -357,8 +357,8 @@ func (h *userExampleHandler) ListByIDs(c *gin.Context) {
|
|||
})
|
||||
}
|
||||
|
||||
// ListByLastID get a list of userExample by last id
|
||||
// @Summary get a list of userExample by last id
|
||||
// ListByLastID get a paginated list of userExamples by last id
|
||||
// @Summary Get a paginated list of userExamples by last id
|
||||
// @Description Returns a paginated list of userExamples starting after a given last id, useful for cursor-based pagination.
|
||||
// @Tags userExample
|
||||
// @Accept json
|
||||
|
|
|
@ -35,12 +35,12 @@ func (h *userExampleHandler) UpdateByID(ctx context.Context, req *serverNameExam
|
|||
return h.server.UpdateByID(ctx, req)
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (h *userExampleHandler) GetByID(ctx context.Context, req *serverNameExampleV1.GetUserExampleByIDRequest) (*serverNameExampleV1.GetUserExampleByIDReply, error) {
|
||||
return h.server.GetByID(ctx, req)
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
func (h *userExampleHandler) List(ctx context.Context, req *serverNameExampleV1.ListUserExampleRequest) (*serverNameExampleV1.ListUserExampleReply, error) {
|
||||
return h.server.List(ctx, req)
|
||||
}
|
||||
|
|
|
@ -35,32 +35,32 @@ func (h *userExampleHandler) UpdateByID(ctx context.Context, req *serverNameExam
|
|||
return h.server.UpdateByID(ctx, req)
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (h *userExampleHandler) GetByID(ctx context.Context, req *serverNameExampleV1.GetUserExampleByIDRequest) (*serverNameExampleV1.GetUserExampleByIDReply, error) {
|
||||
return h.server.GetByID(ctx, req)
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
func (h *userExampleHandler) List(ctx context.Context, req *serverNameExampleV1.ListUserExampleRequest) (*serverNameExampleV1.ListUserExampleReply, error) {
|
||||
return h.server.List(ctx, req)
|
||||
}
|
||||
|
||||
// DeleteByIDs delete userExample by batch id
|
||||
// DeleteByIDs batch delete userExample by ids
|
||||
func (h *userExampleHandler) DeleteByIDs(ctx context.Context, req *serverNameExampleV1.DeleteUserExampleByIDsRequest) (*serverNameExampleV1.DeleteUserExampleByIDsReply, error) {
|
||||
return h.server.DeleteByIDs(ctx, req)
|
||||
}
|
||||
|
||||
// GetByCondition get userExample details by custom condition
|
||||
// GetByCondition get a userExample by custom condition
|
||||
func (h *userExampleHandler) GetByCondition(ctx context.Context, req *serverNameExampleV1.GetUserExampleByConditionRequest) (*serverNameExampleV1.GetUserExampleByConditionReply, error) {
|
||||
return h.server.GetByCondition(ctx, req)
|
||||
}
|
||||
|
||||
// ListByIDs get a list of userExample by batch id
|
||||
// ListByIDs batch get userExample by ids
|
||||
func (h *userExampleHandler) ListByIDs(ctx context.Context, req *serverNameExampleV1.ListUserExampleByIDsRequest) (*serverNameExampleV1.ListUserExampleByIDsReply, error) {
|
||||
return h.server.ListByIDs(ctx, req)
|
||||
}
|
||||
|
||||
// ListByLastID get a list of userExample by last id
|
||||
// ListByLastID get a paginated list of userExamples by last id
|
||||
func (h *userExampleHandler) ListByLastID(ctx context.Context, req *serverNameExampleV1.ListUserExampleByLastIDRequest) (*serverNameExampleV1.ListUserExampleByLastIDReply, error) {
|
||||
return h.server.ListByLastID(ctx, req)
|
||||
}
|
||||
|
|
|
@ -35,32 +35,32 @@ func (h *{{.TableNameCamelFCL}}Handler) UpdateBy{{.ColumnNameCamel}}(ctx context
|
|||
return h.server.UpdateBy{{.ColumnNameCamel}}(ctx, req)
|
||||
}
|
||||
|
||||
// GetBy{{.ColumnNameCamel}} get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// GetBy{{.ColumnNameCamel}} get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
func (h *{{.TableNameCamelFCL}}Handler) GetBy{{.ColumnNameCamel}}(ctx context.Context, req *serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Request) (*serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply, error) {
|
||||
return h.server.GetBy{{.ColumnNameCamel}}(ctx, req)
|
||||
}
|
||||
|
||||
// List get a list of {{.TableNameCamelFCL}} by custom conditions
|
||||
// List get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
func (h *{{.TableNameCamelFCL}}Handler) List(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}Reply, error) {
|
||||
return h.server.List(ctx, req)
|
||||
}
|
||||
|
||||
// DeleteBy{{.ColumnNamePluralCamel}} delete {{.TableNameCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// DeleteBy{{.ColumnNamePluralCamel}} batch delete {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
func (h *{{.TableNameCamelFCL}}Handler) DeleteBy{{.ColumnNamePluralCamel}}(ctx context.Context, req *serverNameExampleV1.Delete{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Request) (*serverNameExampleV1.Delete{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Reply, error) {
|
||||
return h.server.DeleteBy{{.ColumnNamePluralCamel}}(ctx, req)
|
||||
}
|
||||
|
||||
// GetByCondition get {{.TableNameCamelFCL}} details by custom condition
|
||||
// GetByCondition get a {{.TableNameCamelFCL}} by custom condition
|
||||
func (h *{{.TableNameCamelFCL}}Handler) GetByCondition(ctx context.Context, req *serverNameExampleV1.Get{{.TableNameCamel}}ByConditionRequest) (*serverNameExampleV1.Get{{.TableNameCamel}}ByConditionReply, error) {
|
||||
return h.server.GetByCondition(ctx, req)
|
||||
}
|
||||
|
||||
// ListBy{{.ColumnNamePluralCamel}} get a list of {{.TableNameCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// ListBy{{.ColumnNamePluralCamel}} batch get {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
func (h *{{.TableNameCamelFCL}}Handler) ListBy{{.ColumnNamePluralCamel}}(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Reply, error) {
|
||||
return h.server.ListBy{{.ColumnNamePluralCamel}}(ctx, req)
|
||||
}
|
||||
|
||||
// ListByLast{{.ColumnNameCamel}} get a list of {{.TableNameCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
// ListByLast{{.ColumnNameCamel}} get a paginated list of {{.TableNamePluralCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
func (h *{{.TableNameCamelFCL}}Handler) ListByLast{{.ColumnNameCamel}}(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}ByLast{{.ColumnNameCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}ByLast{{.ColumnNameCamel}}Reply, error) {
|
||||
return h.server.ListByLast{{.ColumnNameCamel}}(ctx, req)
|
||||
}
|
||||
|
|
|
@ -35,12 +35,12 @@ func (h *{{.TableNameCamelFCL}}Handler) UpdateBy{{.ColumnNameCamel}}(ctx context
|
|||
return h.server.UpdateBy{{.ColumnNameCamel}}(ctx, req)
|
||||
}
|
||||
|
||||
// GetBy{{.ColumnNameCamel}} get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// GetBy{{.ColumnNameCamel}} get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
func (h *{{.TableNameCamelFCL}}Handler) GetBy{{.ColumnNameCamel}}(ctx context.Context, req *serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Request) (*serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply, error) {
|
||||
return h.server.GetBy{{.ColumnNameCamel}}(ctx, req)
|
||||
}
|
||||
|
||||
// List get a list of {{.TableNameCamelFCL}} by custom conditions
|
||||
// List get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
func (h *{{.TableNameCamelFCL}}Handler) List(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}Reply, error) {
|
||||
return h.server.List(ctx, req)
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ func New{{.TableNameCamel}}Handler() {{.TableNameCamel}}Handler {
|
|||
}
|
||||
|
||||
// Create a new {{.TableNameCamelFCL}}
|
||||
// @Summary create a new {{.TableNameCamelFCL}}
|
||||
// @Summary Create a new {{.TableNameCamelFCL}}
|
||||
// @Description Creates a new {{.TableNameCamelFCL}} entity using the provided data in the request body.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Accept json
|
||||
|
@ -83,7 +83,7 @@ func (h *{{.TableNameCamelFCL}}Handler) Create(c *gin.Context) {
|
|||
}
|
||||
|
||||
// DeleteBy{{.ColumnNameCamel}} delete a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Summary delete a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Summary Delete a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Description Deletes a existing {{.TableNameCamelFCL}} identified by the given {{.ColumnNameCamelFCL}} in the path.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Accept json
|
||||
|
@ -111,7 +111,7 @@ func (h *{{.TableNameCamelFCL}}Handler) DeleteBy{{.ColumnNameCamel}}(c *gin.Cont
|
|||
}
|
||||
|
||||
// UpdateBy{{.ColumnNameCamel}} update a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Summary update a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Summary Update a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Description Updates the specified {{.TableNameCamelFCL}} by given {{.ColumnNameCamelFCL}} in the path, support partial update.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Accept json
|
||||
|
@ -156,8 +156,8 @@ func (h *{{.TableNameCamelFCL}}Handler) UpdateBy{{.ColumnNameCamel}}(c *gin.Cont
|
|||
response.Success(c)
|
||||
}
|
||||
|
||||
// GetBy{{.ColumnNameCamel}} get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// @Summary get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// GetBy{{.ColumnNameCamel}} get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Summary Get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
// @Description Gets detailed information of a {{.TableNameCamelFCL}} specified by the given {{.ColumnNameCamelFCL}} in the path.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Param {{.ColumnNameCamelFCL}} path string true "{{.ColumnNameCamelFCL}}"
|
||||
|
@ -197,8 +197,8 @@ func (h *{{.TableNameCamelFCL}}Handler) GetBy{{.ColumnNameCamel}}(c *gin.Context
|
|||
response.Success(c, gin.H{"{{.TableNameCamelFCL}}": data})
|
||||
}
|
||||
|
||||
// List get a list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
// @Summary get a list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
// List get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
// @Summary Get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
// @Description Returns a paginated list of {{.TableNamePluralCamelFCL}} based on query filters, including page number and size.
|
||||
// @Tags {{.TableNameCamelFCL}}
|
||||
// @Accept json
|
||||
|
|
|
@ -102,7 +102,7 @@ func (h *userExamplePbHandler) UpdateByID(ctx context.Context, req *serverNameEx
|
|||
return &serverNameExampleV1.UpdateUserExampleByIDReply{}, nil
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (h *userExamplePbHandler) GetByID(ctx context.Context, req *serverNameExampleV1.GetUserExampleByIDRequest) (*serverNameExampleV1.GetUserExampleByIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -131,7 +131,7 @@ func (h *userExamplePbHandler) GetByID(ctx context.Context, req *serverNameExamp
|
|||
}, nil
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
func (h *userExamplePbHandler) List(ctx context.Context, req *serverNameExampleV1.ListUserExampleRequest) (*serverNameExampleV1.ListUserExampleReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -103,7 +103,7 @@ func (h *userExamplePbHandler) UpdateByID(ctx context.Context, req *serverNameEx
|
|||
return &serverNameExampleV1.UpdateUserExampleByIDReply{}, nil
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (h *userExamplePbHandler) GetByID(ctx context.Context, req *serverNameExampleV1.GetUserExampleByIDRequest) (*serverNameExampleV1.GetUserExampleByIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -132,7 +132,7 @@ func (h *userExamplePbHandler) GetByID(ctx context.Context, req *serverNameExamp
|
|||
}, nil
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
func (h *userExamplePbHandler) List(ctx context.Context, req *serverNameExampleV1.ListUserExampleRequest) (*serverNameExampleV1.ListUserExampleReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -173,7 +173,7 @@ func (h *userExamplePbHandler) List(ctx context.Context, req *serverNameExampleV
|
|||
}, nil
|
||||
}
|
||||
|
||||
// DeleteByIDs delete userExample by batch id
|
||||
// DeleteByIDs batch delete userExample by ids
|
||||
func (h *userExamplePbHandler) DeleteByIDs(ctx context.Context, req *serverNameExampleV1.DeleteUserExampleByIDsRequest) (*serverNameExampleV1.DeleteUserExampleByIDsReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -190,7 +190,7 @@ func (h *userExamplePbHandler) DeleteByIDs(ctx context.Context, req *serverNameE
|
|||
return &serverNameExampleV1.DeleteUserExampleByIDsReply{}, nil
|
||||
}
|
||||
|
||||
// GetByCondition get userExample details by custom condition
|
||||
// GetByCondition get a userExample by custom condition
|
||||
func (h *userExamplePbHandler) GetByCondition(ctx context.Context, req *serverNameExampleV1.GetUserExampleByConditionRequest) (*serverNameExampleV1.GetUserExampleByConditionReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -231,7 +231,7 @@ func (h *userExamplePbHandler) GetByCondition(ctx context.Context, req *serverNa
|
|||
}, nil
|
||||
}
|
||||
|
||||
// ListByIDs get a list of userExample by batch id
|
||||
// ListByIDs batch get userExample by ids
|
||||
func (h *userExamplePbHandler) ListByIDs(ctx context.Context, req *serverNameExampleV1.ListUserExampleByIDsRequest) (*serverNameExampleV1.ListUserExampleByIDsReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -262,7 +262,7 @@ func (h *userExamplePbHandler) ListByIDs(ctx context.Context, req *serverNameExa
|
|||
}, nil
|
||||
}
|
||||
|
||||
// ListByLastID get a list of userExample by last id
|
||||
// ListByLastID get a paginated list of userExamples by last id
|
||||
func (h *userExamplePbHandler) ListByLastID(ctx context.Context, req *serverNameExampleV1.ListUserExampleByLastIDRequest) (*serverNameExampleV1.ListUserExampleByLastIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -103,7 +103,7 @@ func (h *{{.TableNameCamelFCL}}Handler) UpdateBy{{.ColumnNameCamel}}(ctx context
|
|||
return &serverNameExampleV1.Update{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply{}, nil
|
||||
}
|
||||
|
||||
// GetBy{{.ColumnNameCamel}} get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// GetBy{{.ColumnNameCamel}} get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
func (h *{{.TableNameCamelFCL}}Handler) GetBy{{.ColumnNameCamel}}(ctx context.Context, req *serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Request) (*serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -132,7 +132,7 @@ func (h *{{.TableNameCamelFCL}}Handler) GetBy{{.ColumnNameCamel}}(ctx context.Co
|
|||
}, nil
|
||||
}
|
||||
|
||||
// List get a list of {{.TableNameCamelFCL}} by custom conditions
|
||||
// List get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
func (h *{{.TableNameCamelFCL}}Handler) List(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -173,7 +173,7 @@ func (h *{{.TableNameCamelFCL}}Handler) List(ctx context.Context, req *serverNam
|
|||
}, nil
|
||||
}
|
||||
|
||||
// DeleteBy{{.ColumnNamePluralCamel}} delete {{.TableNameCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// DeleteBy{{.ColumnNamePluralCamel}} batch delete {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
func (h *{{.TableNameCamelFCL}}Handler) DeleteBy{{.ColumnNamePluralCamel}}(ctx context.Context, req *serverNameExampleV1.Delete{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Request) (*serverNameExampleV1.Delete{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -190,7 +190,7 @@ func (h *{{.TableNameCamelFCL}}Handler) DeleteBy{{.ColumnNamePluralCamel}}(ctx c
|
|||
return &serverNameExampleV1.Delete{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Reply{}, nil
|
||||
}
|
||||
|
||||
// GetByCondition get {{.TableNameCamelFCL}} details by custom condition
|
||||
// GetByCondition get a {{.TableNameCamelFCL}} by custom condition
|
||||
func (h *{{.TableNameCamelFCL}}Handler) GetByCondition(ctx context.Context, req *serverNameExampleV1.Get{{.TableNameCamel}}ByConditionRequest) (*serverNameExampleV1.Get{{.TableNameCamel}}ByConditionReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -231,7 +231,7 @@ func (h *{{.TableNameCamelFCL}}Handler) GetByCondition(ctx context.Context, req
|
|||
}, nil
|
||||
}
|
||||
|
||||
// ListBy{{.ColumnNamePluralCamel}} get a list of {{.TableNameCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// ListBy{{.ColumnNamePluralCamel}} batch get {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
func (h *{{.TableNameCamelFCL}}Handler) ListBy{{.ColumnNamePluralCamel}}(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -262,7 +262,7 @@ func (h *{{.TableNameCamelFCL}}Handler) ListBy{{.ColumnNamePluralCamel}}(ctx con
|
|||
}, nil
|
||||
}
|
||||
|
||||
// ListByLast{{.ColumnNameCamel}} get a list of {{.TableNameCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
// ListByLast{{.ColumnNameCamel}} get a paginated list of {{.TableNamePluralCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
func (h *{{.TableNameCamelFCL}}Handler) ListByLast{{.ColumnNameCamel}}(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}ByLast{{.ColumnNameCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}ByLast{{.ColumnNameCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -103,7 +103,7 @@ func (h *userExamplePbHandler) UpdateByID(ctx context.Context, req *serverNameEx
|
|||
return &serverNameExampleV1.UpdateUserExampleByIDReply{}, nil
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (h *userExamplePbHandler) GetByID(ctx context.Context, req *serverNameExampleV1.GetUserExampleByIDRequest) (*serverNameExampleV1.GetUserExampleByIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -132,7 +132,7 @@ func (h *userExamplePbHandler) GetByID(ctx context.Context, req *serverNameExamp
|
|||
}, nil
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
func (h *userExamplePbHandler) List(ctx context.Context, req *serverNameExampleV1.ListUserExampleRequest) (*serverNameExampleV1.ListUserExampleReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -103,7 +103,7 @@ func (h *userExamplePbHandler) UpdateByID(ctx context.Context, req *serverNameEx
|
|||
return &serverNameExampleV1.UpdateUserExampleByIDReply{}, nil
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (h *userExamplePbHandler) GetByID(ctx context.Context, req *serverNameExampleV1.GetUserExampleByIDRequest) (*serverNameExampleV1.GetUserExampleByIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -132,7 +132,7 @@ func (h *userExamplePbHandler) GetByID(ctx context.Context, req *serverNameExamp
|
|||
}, nil
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
func (h *userExamplePbHandler) List(ctx context.Context, req *serverNameExampleV1.ListUserExampleRequest) (*serverNameExampleV1.ListUserExampleReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -173,7 +173,7 @@ func (h *userExamplePbHandler) List(ctx context.Context, req *serverNameExampleV
|
|||
}, nil
|
||||
}
|
||||
|
||||
// DeleteByIDs delete userExample by batch id
|
||||
// DeleteByIDs batch delete userExample by ids
|
||||
func (h *userExamplePbHandler) DeleteByIDs(ctx context.Context, req *serverNameExampleV1.DeleteUserExampleByIDsRequest) (*serverNameExampleV1.DeleteUserExampleByIDsReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -190,7 +190,7 @@ func (h *userExamplePbHandler) DeleteByIDs(ctx context.Context, req *serverNameE
|
|||
return &serverNameExampleV1.DeleteUserExampleByIDsReply{}, nil
|
||||
}
|
||||
|
||||
// GetByCondition get userExample details by custom condition
|
||||
// GetByCondition get a userExample by custom condition
|
||||
func (h *userExamplePbHandler) GetByCondition(ctx context.Context, req *serverNameExampleV1.GetUserExampleByConditionRequest) (*serverNameExampleV1.GetUserExampleByConditionReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -231,7 +231,7 @@ func (h *userExamplePbHandler) GetByCondition(ctx context.Context, req *serverNa
|
|||
}, nil
|
||||
}
|
||||
|
||||
// ListByIDs get a list of userExample by batch id
|
||||
// ListByIDs batch get userExample by ids
|
||||
func (h *userExamplePbHandler) ListByIDs(ctx context.Context, req *serverNameExampleV1.ListUserExampleByIDsRequest) (*serverNameExampleV1.ListUserExampleByIDsReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -262,7 +262,7 @@ func (h *userExamplePbHandler) ListByIDs(ctx context.Context, req *serverNameExa
|
|||
}, nil
|
||||
}
|
||||
|
||||
// ListByLastID get a list of userExample by last id
|
||||
// ListByLastID get a paginated list of userExamples by last id
|
||||
func (h *userExamplePbHandler) ListByLastID(ctx context.Context, req *serverNameExampleV1.ListUserExampleByLastIDRequest) (*serverNameExampleV1.ListUserExampleByLastIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -102,7 +102,7 @@ func (h *{{.TableNameCamelFCL}}Handler) UpdateBy{{.ColumnNameCamel}}(ctx context
|
|||
return &serverNameExampleV1.Update{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply{}, nil
|
||||
}
|
||||
|
||||
// GetBy{{.ColumnNameCamel}} get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// GetBy{{.ColumnNameCamel}} get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
func (h *{{.TableNameCamelFCL}}Handler) GetBy{{.ColumnNameCamel}}(ctx context.Context, req *serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Request) (*serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -131,7 +131,7 @@ func (h *{{.TableNameCamelFCL}}Handler) GetBy{{.ColumnNameCamel}}(ctx context.Co
|
|||
}, nil
|
||||
}
|
||||
|
||||
// List get a list of {{.TableNameCamelFCL}} by custom conditions
|
||||
// List get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
func (h *{{.TableNameCamelFCL}}Handler) List(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -115,7 +115,7 @@ func (s *userExample) UpdateByID(ctx context.Context, req *serverNameExampleV1.U
|
|||
return &serverNameExampleV1.UpdateUserExampleByIDReply{}, nil
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (s *userExample) GetByID(ctx context.Context, req *serverNameExampleV1.GetUserExampleByIDRequest) (*serverNameExampleV1.GetUserExampleByIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -143,7 +143,7 @@ func (s *userExample) GetByID(ctx context.Context, req *serverNameExampleV1.GetU
|
|||
return &serverNameExampleV1.GetUserExampleByIDReply{UserExample: data}, nil
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
func (s *userExample) List(ctx context.Context, req *serverNameExampleV1.ListUserExampleRequest) (*serverNameExampleV1.ListUserExampleReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -116,7 +116,7 @@ func (s *userExample) UpdateByID(ctx context.Context, req *serverNameExampleV1.U
|
|||
return &serverNameExampleV1.UpdateUserExampleByIDReply{}, nil
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (s *userExample) GetByID(ctx context.Context, req *serverNameExampleV1.GetUserExampleByIDRequest) (*serverNameExampleV1.GetUserExampleByIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -144,7 +144,7 @@ func (s *userExample) GetByID(ctx context.Context, req *serverNameExampleV1.GetU
|
|||
return &serverNameExampleV1.GetUserExampleByIDReply{UserExample: data}, nil
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
func (s *userExample) List(ctx context.Context, req *serverNameExampleV1.ListUserExampleRequest) (*serverNameExampleV1.ListUserExampleReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -186,7 +186,7 @@ func (s *userExample) List(ctx context.Context, req *serverNameExampleV1.ListUse
|
|||
}, nil
|
||||
}
|
||||
|
||||
// DeleteByIDs delete userExample by batch id
|
||||
// DeleteByIDs batch delete userExample by ids
|
||||
func (s *userExample) DeleteByIDs(ctx context.Context, req *serverNameExampleV1.DeleteUserExampleByIDsRequest) (*serverNameExampleV1.DeleteUserExampleByIDsReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -204,7 +204,7 @@ func (s *userExample) DeleteByIDs(ctx context.Context, req *serverNameExampleV1.
|
|||
return &serverNameExampleV1.DeleteUserExampleByIDsReply{}, nil
|
||||
}
|
||||
|
||||
// GetByCondition get userExample details by custom condition
|
||||
// GetByCondition get a userExample by custom condition
|
||||
func (s *userExample) GetByCondition(ctx context.Context, req *serverNameExampleV1.GetUserExampleByConditionRequest) (*serverNameExampleV1.GetUserExampleByConditionReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -246,7 +246,7 @@ func (s *userExample) GetByCondition(ctx context.Context, req *serverNameExample
|
|||
}, nil
|
||||
}
|
||||
|
||||
// ListByIDs get a list of userExample by batch id
|
||||
// ListByIDs batch get userExample by ids
|
||||
func (s *userExample) ListByIDs(ctx context.Context, req *serverNameExampleV1.ListUserExampleByIDsRequest) (*serverNameExampleV1.ListUserExampleByIDsReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -276,7 +276,7 @@ func (s *userExample) ListByIDs(ctx context.Context, req *serverNameExampleV1.Li
|
|||
return &serverNameExampleV1.ListUserExampleByIDsReply{UserExamples: userExamples}, nil
|
||||
}
|
||||
|
||||
// ListByLastID get a list of userExample by last id
|
||||
// ListByLastID get a paginated list of userExamples by last id
|
||||
func (s *userExample) ListByLastID(ctx context.Context, req *serverNameExampleV1.ListUserExampleByLastIDRequest) (*serverNameExampleV1.ListUserExampleByLastIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -116,7 +116,7 @@ func (s *{{.TableNameCamelFCL}}) UpdateBy{{.ColumnNameCamel}}(ctx context.Contex
|
|||
return &serverNameExampleV1.Update{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply{}, nil
|
||||
}
|
||||
|
||||
// GetBy{{.ColumnNameCamel}} get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// GetBy{{.ColumnNameCamel}} get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
func (s *{{.TableNameCamelFCL}}) GetBy{{.ColumnNameCamel}}(ctx context.Context, req *serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Request) (*serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -144,7 +144,7 @@ func (s *{{.TableNameCamelFCL}}) GetBy{{.ColumnNameCamel}}(ctx context.Context,
|
|||
return &serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply{ {{.TableNameCamel}}: data}, nil
|
||||
}
|
||||
|
||||
// List get a list of {{.TableNameCamelFCL}} by custom conditions
|
||||
// List get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
func (s *{{.TableNameCamelFCL}}) List(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -186,7 +186,7 @@ func (s *{{.TableNameCamelFCL}}) List(ctx context.Context, req *serverNameExampl
|
|||
}, nil
|
||||
}
|
||||
|
||||
// DeleteBy{{.ColumnNamePluralCamel}} delete {{.TableNameCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// DeleteBy{{.ColumnNamePluralCamel}} batch delete {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
func (s *{{.TableNameCamelFCL}}) DeleteBy{{.ColumnNamePluralCamel}}(ctx context.Context, req *serverNameExampleV1.Delete{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Request) (*serverNameExampleV1.Delete{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -204,7 +204,7 @@ func (s *{{.TableNameCamelFCL}}) DeleteBy{{.ColumnNamePluralCamel}}(ctx context.
|
|||
return &serverNameExampleV1.Delete{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Reply{}, nil
|
||||
}
|
||||
|
||||
// GetByCondition get {{.TableNameCamelFCL}} details by custom condition
|
||||
// GetByCondition get a {{.TableNameCamelFCL}} by custom condition
|
||||
func (s *{{.TableNameCamelFCL}}) GetByCondition(ctx context.Context, req *serverNameExampleV1.Get{{.TableNameCamel}}ByConditionRequest) (*serverNameExampleV1.Get{{.TableNameCamel}}ByConditionReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -246,7 +246,7 @@ func (s *{{.TableNameCamelFCL}}) GetByCondition(ctx context.Context, req *server
|
|||
}, nil
|
||||
}
|
||||
|
||||
// ListBy{{.ColumnNamePluralCamel}} get a list of {{.TableNameCamelFCL}} by batch {{.ColumnNameCamelFCL}}
|
||||
// ListBy{{.ColumnNamePluralCamel}} batch get {{.TableNamePluralCamelFCL}} by {{.ColumnNamePluralCamelFCL}}
|
||||
func (s *{{.TableNameCamelFCL}}) ListBy{{.ColumnNamePluralCamel}}(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -276,7 +276,7 @@ func (s *{{.TableNameCamelFCL}}) ListBy{{.ColumnNamePluralCamel}}(ctx context.Co
|
|||
return &serverNameExampleV1.List{{.TableNameCamel}}By{{.ColumnNamePluralCamel}}Reply{ {{.TableNamePluralCamel}}: {{.TableNamePluralCamelFCL}} }, nil
|
||||
}
|
||||
|
||||
// ListByLast{{.ColumnNameCamel}} get a list of {{.TableNameCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
// ListByLast{{.ColumnNameCamel}} get a paginated list of {{.TableNamePluralCamelFCL}} by last {{.ColumnNameCamelFCL}}
|
||||
func (s *{{.TableNameCamelFCL}}) ListByLast{{.ColumnNameCamel}}(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}ByLast{{.ColumnNameCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}ByLast{{.ColumnNameCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -116,7 +116,7 @@ func (s *userExample) UpdateByID(ctx context.Context, req *serverNameExampleV1.U
|
|||
return &serverNameExampleV1.UpdateUserExampleByIDReply{}, nil
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (s *userExample) GetByID(ctx context.Context, req *serverNameExampleV1.GetUserExampleByIDRequest) (*serverNameExampleV1.GetUserExampleByIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -144,7 +144,7 @@ func (s *userExample) GetByID(ctx context.Context, req *serverNameExampleV1.GetU
|
|||
return &serverNameExampleV1.GetUserExampleByIDReply{UserExample: data}, nil
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
func (s *userExample) List(ctx context.Context, req *serverNameExampleV1.ListUserExampleRequest) (*serverNameExampleV1.ListUserExampleReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -116,7 +116,7 @@ func (s *userExample) UpdateByID(ctx context.Context, req *serverNameExampleV1.U
|
|||
return &serverNameExampleV1.UpdateUserExampleByIDReply{}, nil
|
||||
}
|
||||
|
||||
// GetByID get userExample details by id
|
||||
// GetByID get a userExample by id
|
||||
func (s *userExample) GetByID(ctx context.Context, req *serverNameExampleV1.GetUserExampleByIDRequest) (*serverNameExampleV1.GetUserExampleByIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -144,7 +144,7 @@ func (s *userExample) GetByID(ctx context.Context, req *serverNameExampleV1.GetU
|
|||
return &serverNameExampleV1.GetUserExampleByIDReply{UserExample: data}, nil
|
||||
}
|
||||
|
||||
// List get a list of userExample by custom conditions
|
||||
// List get a paginated list of userExamples by custom conditions
|
||||
func (s *userExample) List(ctx context.Context, req *serverNameExampleV1.ListUserExampleRequest) (*serverNameExampleV1.ListUserExampleReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -186,7 +186,7 @@ func (s *userExample) List(ctx context.Context, req *serverNameExampleV1.ListUse
|
|||
}, nil
|
||||
}
|
||||
|
||||
// DeleteByIDs delete userExample by batch id
|
||||
// DeleteByIDs batch delete userExample by ids
|
||||
func (s *userExample) DeleteByIDs(ctx context.Context, req *serverNameExampleV1.DeleteUserExampleByIDsRequest) (*serverNameExampleV1.DeleteUserExampleByIDsReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -204,7 +204,7 @@ func (s *userExample) DeleteByIDs(ctx context.Context, req *serverNameExampleV1.
|
|||
return &serverNameExampleV1.DeleteUserExampleByIDsReply{}, nil
|
||||
}
|
||||
|
||||
// GetByCondition get userExample details by custom condition
|
||||
// GetByCondition get a userExample by custom condition
|
||||
func (s *userExample) GetByCondition(ctx context.Context, req *serverNameExampleV1.GetUserExampleByConditionRequest) (*serverNameExampleV1.GetUserExampleByConditionReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -246,7 +246,7 @@ func (s *userExample) GetByCondition(ctx context.Context, req *serverNameExample
|
|||
}, nil
|
||||
}
|
||||
|
||||
// ListByIDs get a list of userExample by batch id
|
||||
// ListByIDs batch get userExample by ids
|
||||
func (s *userExample) ListByIDs(ctx context.Context, req *serverNameExampleV1.ListUserExampleByIDsRequest) (*serverNameExampleV1.ListUserExampleByIDsReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -276,7 +276,7 @@ func (s *userExample) ListByIDs(ctx context.Context, req *serverNameExampleV1.Li
|
|||
return &serverNameExampleV1.ListUserExampleByIDsReply{UserExamples: userExamples}, nil
|
||||
}
|
||||
|
||||
// ListByLastID get a list of userExample by last id
|
||||
// ListByLastID get a paginated list of userExamples by last id
|
||||
func (s *userExample) ListByLastID(ctx context.Context, req *serverNameExampleV1.ListUserExampleByLastIDRequest) (*serverNameExampleV1.ListUserExampleByLastIDReply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -115,7 +115,7 @@ func (s *{{.TableNameCamelFCL}}) UpdateBy{{.ColumnNameCamel}}(ctx context.Contex
|
|||
return &serverNameExampleV1.Update{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply{}, nil
|
||||
}
|
||||
|
||||
// GetBy{{.ColumnNameCamel}} get {{.TableNameCamelFCL}} details by {{.ColumnNameCamelFCL}}
|
||||
// GetBy{{.ColumnNameCamel}} get a {{.TableNameCamelFCL}} by {{.ColumnNameCamelFCL}}
|
||||
func (s *{{.TableNameCamelFCL}}) GetBy{{.ColumnNameCamel}}(ctx context.Context, req *serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Request) (*serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
@ -143,7 +143,7 @@ func (s *{{.TableNameCamelFCL}}) GetBy{{.ColumnNameCamel}}(ctx context.Context,
|
|||
return &serverNameExampleV1.Get{{.TableNameCamel}}By{{.ColumnNameCamel}}Reply{ {{.TableNameCamel}}: data}, nil
|
||||
}
|
||||
|
||||
// List get a list of {{.TableNameCamelFCL}} by custom conditions
|
||||
// List get a paginated list of {{.TableNamePluralCamelFCL}} by custom conditions
|
||||
func (s *{{.TableNameCamelFCL}}) List(ctx context.Context, req *serverNameExampleV1.List{{.TableNameCamel}}Request) (*serverNameExampleV1.List{{.TableNameCamel}}Reply, error) {
|
||||
err := req.Validate()
|
||||
if err != nil {
|
||||
|
|
|
@ -47,7 +47,7 @@ func setCrudInfo(field tmplField) *CrudInfo {
|
|||
}
|
||||
pluralName := inflection.Plural(field.Name)
|
||||
|
||||
return &CrudInfo{
|
||||
info := &CrudInfo{
|
||||
ColumnName: field.ColName,
|
||||
ColumnNameCamel: field.Name,
|
||||
ColumnNameCamelFCL: customFirstLetterToLower(field.Name),
|
||||
|
@ -60,6 +60,15 @@ func setCrudInfo(field tmplField) *CrudInfo {
|
|||
PrimaryKeyColumnName: primaryKeyName,
|
||||
IsStandardPrimaryKey: field.ColName == "id",
|
||||
}
|
||||
|
||||
if info.ColumnNameCamel == info.ColumnNamePluralCamel {
|
||||
info.ColumnNamePluralCamel += "s" // if singular and plural are the same, force the suffix 's' to distinguish them
|
||||
}
|
||||
if info.ColumnNameCamelFCL == info.ColumnNamePluralCamelFCL {
|
||||
info.ColumnNamePluralCamelFCL += "s" // if singular and plural are the same, force the suffix 's' to distinguish them
|
||||
}
|
||||
|
||||
return info
|
||||
}
|
||||
|
||||
func newCrudInfo(data tmplData) *CrudInfo {
|
||||
|
|
Loading…
Reference in New Issue