admin

command module
v0.0.0-...-be8d9e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

一个根据struct文件生成后端api 和前端页面的工具


struct

  • 注释介绍:
    • struct
      1. //@curd :本工具会使用的注释
      2. name=前端页面名字;page=是否分页(Boolean)
    • struct.field
      1. name: 页面显示名字
      2. search 是否支持搜索
      3. type: 页面显示类型
        1. select select([{"label":"label","value":"value"},{"label":"label1","value":"value1"}])
        2. checkbox
        3. editor
        4. input
        5. radio
        6. textarea
        7. upload 4.sort:是否用于排序
  • 列子:
//@curd:name=管理员;page=管理员 
type Admin struct {
	gorm.Model
	//@curd:name=管理员;search=true;type=select(banner);sort=1
	Name string `gorm:"type:varchar(100)" json:"name" binding:"required"`
	//@curd:name=密码;search=true;type=select([{"label":"label","value":"value"},{"label":"label1","value":"value1"}]);sort=2
	Password string  `gorm:"type:varchar(100)"json:"password"`
}

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL