Compare commits
2 Commits
v1.0.7
...
da19da2d63
| Author | SHA1 | Date | |
|---|---|---|---|
| da19da2d63 | |||
| e1012c234c |
@@ -3,7 +3,7 @@
|
||||
|
||||
## Install
|
||||
```shell
|
||||
go install git.gogacoder.ru/NTO/crudgen/cmd/crudgen@v1.0.7
|
||||
go install git.gogacoder.ru/NTO/crudgen/cmd/crudgen@v1.0.9
|
||||
```
|
||||
|
||||
## Run
|
||||
|
||||
@@ -54,3 +54,7 @@ const CountRawTemplate = `func (service *{{.ServiceName}}) Count() (int64, error
|
||||
amount, err := dal.{{.EntityType}}.Count()
|
||||
return amount, err
|
||||
}`
|
||||
|
||||
const SortedByOrderTemplate = `func (service *{{.ServiceName}}) SortedByOrder(fieldsSortOrder map[string]string) ([]*{{.EntityType}}, error) {
|
||||
return utils.SortByOrder(fieldsSortOrder, {{.EntityType}}{})
|
||||
}`
|
||||
|
||||
@@ -22,12 +22,14 @@ const GetByIdMethod = "GetById"
|
||||
const UpdateMethod = "Update"
|
||||
const DeleteMethod = "Delete"
|
||||
const CountMethod = "Count"
|
||||
const SortedByOrderMethod = "SortedByOrder"
|
||||
|
||||
var RawTemplates = map[string]string{
|
||||
CreateMethod: CreateRawTemplate,
|
||||
GetAllMethod: GetAllRawTemplate,
|
||||
GetByIdMethod: GetByIdRawTemplate,
|
||||
UpdateMethod: UpdateRawTemplate,
|
||||
DeleteMethod: DeleteRawTemplate,
|
||||
CountMethod: CountRawTemplate,
|
||||
CreateMethod: CreateRawTemplate,
|
||||
GetAllMethod: GetAllRawTemplate,
|
||||
GetByIdMethod: GetByIdRawTemplate,
|
||||
UpdateMethod: UpdateRawTemplate,
|
||||
DeleteMethod: DeleteRawTemplate,
|
||||
CountMethod: CountRawTemplate,
|
||||
SortedByOrderMethod: SortedByOrderTemplate,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user