提交 de757504 编写于 作者: L Leonard Wang

修复 go fmt 问题

上级 f6d53141
......@@ -23,13 +23,13 @@ func CreateTemp(c *gin.Context) {
var a model.AutoCodeStruct
_ = c.ShouldBindJSON(&a)
AutoCodeVerify := utils.Rules{
"Abbreviation": {utils.NotEmpty()},
"StructName": {utils.NotEmpty()},
"PackageName": {utils.NotEmpty()},
"Fields": {utils.NotEmpty()},
"Abbreviation": {utils.NotEmpty()},
"StructName": {utils.NotEmpty()},
"PackageName": {utils.NotEmpty()},
"Fields": {utils.NotEmpty()},
}
WKVerifyErr := utils.Verify(a, AutoCodeVerify)
if WKVerifyErr!=nil {
if WKVerifyErr != nil {
response.FailWithMessage(WKVerifyErr.Error(), c)
return
}
......
......@@ -19,13 +19,13 @@ func CreateWorkFlow(c *gin.Context) {
var wk model.SysWorkflow
_ = c.ShouldBindJSON(&wk)
WKVerify := utils.Rules{
"WorkflowNickName": {utils.NotEmpty()},
"WorkflowName": {utils.NotEmpty()},
"WorkflowDescription": {utils.NotEmpty()},
"WorkflowStepInfo": {utils.NotEmpty()},
"WorkflowNickName": {utils.NotEmpty()},
"WorkflowName": {utils.NotEmpty()},
"WorkflowDescription": {utils.NotEmpty()},
"WorkflowStepInfo": {utils.NotEmpty()},
}
WKVerifyErr := utils.Verify(wk, WKVerify)
if WKVerifyErr!=nil {
if WKVerifyErr != nil {
response.FailWithMessage(WKVerifyErr.Error(), c)
return
}
......
......@@ -46,8 +46,8 @@ type Redis struct {
type Qiniu struct {
AccessKey string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"`
SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
ImgPath string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"`
Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
ImgPath string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"`
}
type Captcha struct {
......
......@@ -50,5 +50,5 @@ func FailWithMessage(message string, c *gin.Context) {
}
func FailWithDetailed(code int, data interface{}, message string, c *gin.Context) {
Result(code, data, message, c )
}
\ No newline at end of file
Result(code, data, message, c)
}
......@@ -21,4 +21,4 @@ type ExaFileChunk struct {
ExaFileId uint
FileChunkNumber int
FileChunkPath string
}
\ No newline at end of file
}
......@@ -11,4 +11,4 @@ type ExaCustomer struct {
SysUserID uint `json:"sysUserId" form:"sysUserId"`
SysUserAuthorityID string `json:"sysUserAuthorityID" form:"sysUserAuthorityID"`
SysUser SysUser `json:"sysUser" form:"sysUser"`
}
\ No newline at end of file
}
......@@ -10,4 +10,4 @@ type ExaFileUploadAndDownload struct {
Url string `json:"url"`
Tag string `json:"tag"`
Key string `json:"key"`
}
\ No newline at end of file
}
......@@ -12,4 +12,4 @@ type CustomClaims struct {
NickName string
AuthorityId string
jwt.StandardClaims
}
\ No newline at end of file
}
......@@ -11,4 +11,4 @@ type AddMenuAuthorityInfo struct {
// Get role by id structure
type AuthorityIdInfo struct {
AuthorityId string
}
\ No newline at end of file
}
......@@ -30,4 +30,4 @@ type ChangePasswordStruct struct {
type SetUserAuth struct {
UUID uuid.UUID `json:"uuid"`
AuthorityId string `json:"authorityId"`
}
\ No newline at end of file
}
......@@ -8,4 +8,4 @@ type FilePathResponse struct {
type FileResponse struct {
File model.ExaFile `json:"file"`
}
\ No newline at end of file
}
......@@ -10,4 +10,4 @@ type SysApi struct {
Description string `json:"description"`
ApiGroup string `json:"apiGroup"`
Method string `json:"method" gorm:"default:'POST'"`
}
\ No newline at end of file
}
......@@ -14,4 +14,4 @@ type SysAuthority struct {
DataAuthorityId []SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id;association_jointable_foreignkey:data_authority_id"`
Children []SysAuthority `json:"children"`
SysBaseMenus []SysBaseMenu `json:"menus" gorm:"many2many:sys_authority_menus;"`
}
\ No newline at end of file
}
......@@ -5,4 +5,4 @@ type SysMenu struct {
MenuId string `json:"menuId"`
AuthorityId string `json:"-"`
Children []SysMenu `json:"children"`
}
\ No newline at end of file
}
......@@ -6,4 +6,4 @@ type CasbinModel struct {
AuthorityId string `json:"rolename" gorm:"column:v0"`
Path string `json:"path" gorm:"column:v1"`
Method string `json:"method" gorm:"column:v2"`
}
\ No newline at end of file
}
......@@ -7,4 +7,4 @@ import (
type JwtBlacklist struct {
gorm.Model
Jwt string `gorm:"type:text"`
}
\ No newline at end of file
}
......@@ -7,4 +7,4 @@ import (
//配置文件结构体
type System struct {
Config config.Server
}
\ No newline at end of file
}
......@@ -14,4 +14,4 @@ type SysUser struct {
HeaderImg string `json:"headerImg" gorm:"default:'http://www.henrongyi.top/avatar/lufu.jpg'"`
Authority SysAuthority `json:"authority" gorm:"ForeignKey:AuthorityId;AssociationForeignKey:AuthorityId"`
AuthorityId string `json:"authorityId" gorm:"default:888"`
}
\ No newline at end of file
}
......@@ -22,4 +22,4 @@ type SysWorkflowStepInfo struct {
StepNo float64 `json:"stepNo"` // 步骤id (第几步)
StepAuthorityID string `json:"stepAuthorityID"` // 操作者级别id
IsEnd bool `json:"isEnd"` // 是否是完结流节点
}
\ No newline at end of file
}
......@@ -9,8 +9,8 @@ import (
func InitCustomerRouter(Router *gin.RouterGroup) {
ApiRouter := Router.Group("customer").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
ApiRouter.POST("customer", v1.CreateExaCustomer) // 创建客户
ApiRouter.PUT("customer", v1.UpdateExaCustomer) // 更新客户
ApiRouter.POST("customer", v1.CreateExaCustomer) // 创建客户
ApiRouter.PUT("customer", v1.UpdateExaCustomer) // 更新客户
ApiRouter.DELETE("customer", v1.DeleteExaCustomer) // 删除客户
ApiRouter.GET("customer", v1.GetExaCustomer) // 获取单一客户信息
ApiRouter.GET("customerList", v1.GetExaCustomerList) // 获取客户列表
......
......@@ -13,15 +13,15 @@ import (
// @return err error
// @return menusMsp map{string}[]SysBaseMenu
func getMenuTreeMap(authorityId string)(err error,treeMap map[string][]model.SysMenu){
func getMenuTreeMap(authorityId string) (err error, treeMap map[string][]model.SysMenu) {
var allMenus []model.SysMenu
treeMap = make(map[string][]model.SysMenu)
sql := "SELECT authority_menu.keep_alive,authority_menu.default_menu,authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.menu_id,authority_menu.authority_id FROM authority_menu WHERE authority_menu.authority_id = ? ORDER BY authority_menu.sort ASC"
err = global.GVA_DB.Raw(sql,authorityId).Scan(&allMenus).Error
for _,v := range allMenus{
err = global.GVA_DB.Raw(sql, authorityId).Scan(&allMenus).Error
for _, v := range allMenus {
treeMap[v.ParentId] = append(treeMap[v.ParentId], v)
}
return err,treeMap
return err, treeMap
}
// @title GetMenuTree
......@@ -32,7 +32,7 @@ func getMenuTreeMap(authorityId string)(err error,treeMap map[string][]model.Sys
// @return menus []model.SysMenu
func GetMenuTree(authorityId string) (err error, menus []model.SysMenu) {
err,menuTree := getMenuTreeMap(authorityId)
err, menuTree := getMenuTreeMap(authorityId)
menus = menuTree["0"]
for i := 0; i < len(menus); i++ {
err = getChildrenList(&menus[i], menuTree)
......@@ -47,7 +47,7 @@ func GetMenuTree(authorityId string) (err error, menus []model.SysMenu) {
// @param sql string
// @return err error
func getChildrenList(menu *model.SysMenu,treeMap map[string][]model.SysMenu) (err error) {
func getChildrenList(menu *model.SysMenu, treeMap map[string][]model.SysMenu) (err error) {
menu.Children = treeMap[menu.MenuId]
for i := 0; i < len(menu.Children); i++ {
err = getChildrenList(&menu.Children[i], treeMap)
......@@ -65,10 +65,10 @@ func getChildrenList(menu *model.SysMenu,treeMap map[string][]model.SysMenu) (er
func GetInfoList() (err error, list interface{}, total int) {
var menuList []model.SysBaseMenu
err,treeMap := getBaseMenuTreeMap()
err, treeMap := getBaseMenuTreeMap()
menuList = treeMap["0"]
for i := 0; i < len(menuList); i++ {
err = getBaseChildrenList(&menuList[i],treeMap)
err = getBaseChildrenList(&menuList[i], treeMap)
}
return err, menuList, total
}
......@@ -79,10 +79,10 @@ func GetInfoList() (err error, list interface{}, total int) {
// @param menu *model.SysBaseMenu
// @return err error
func getBaseChildrenList(menu *model.SysBaseMenu ,treeMap map[string][]model.SysBaseMenu) (err error) {
func getBaseChildrenList(menu *model.SysBaseMenu, treeMap map[string][]model.SysBaseMenu) (err error) {
menu.Children = treeMap[strconv.Itoa(int(menu.ID))]
for i := 0; i < len(menu.Children); i++ {
err = getBaseChildrenList(&menu.Children[i],treeMap)
err = getBaseChildrenList(&menu.Children[i], treeMap)
}
return err
}
......@@ -110,14 +110,14 @@ func AddBaseMenu(menu model.SysBaseMenu) (err error) {
// @return err error
// @return menusMsp map{string}[]SysBaseMenu
func getBaseMenuTreeMap()(err error,treeMap map[string][]model.SysBaseMenu){
func getBaseMenuTreeMap() (err error, treeMap map[string][]model.SysBaseMenu) {
var allMenus []model.SysBaseMenu
treeMap = make(map[string][]model.SysBaseMenu)
err = global.GVA_DB.Order("sort", true).Find(&allMenus).Error
for _,v := range allMenus{
for _, v := range allMenus {
treeMap[v.ParentId] = append(treeMap[v.ParentId], v)
}
return err,treeMap
return err, treeMap
}
// @title GetBaseMenuTree
......@@ -127,10 +127,10 @@ func getBaseMenuTreeMap()(err error,treeMap map[string][]model.SysBaseMenu){
// @return menus []SysBaseMenu
func GetBaseMenuTree() (err error, menus []model.SysBaseMenu) {
err,treeMap := getBaseMenuTreeMap()
err, treeMap := getBaseMenuTreeMap()
menus = treeMap["0"]
for i := 0; i < len(menus); i++ {
err = getBaseChildrenList(&menus[i],treeMap)
err = getBaseChildrenList(&menus[i], treeMap)
}
return err, menus
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册