Documentation ¶
Index ¶
- Constants
- Variables
- func GetFieldName(filed reflect.StructField, tagName string) map[string]string
- func GetSelectSQL(tableName string, data interface{}) (sql string)
- func GetSelectsLIMITSQL(tableName string, data interface{}) (sql string)
- func GetSelectsSQL(tableName string, data interface{}) (sql string)
- func MapHas(d map[string]string, key string) bool
- func NewDB(sqlstr string) (db *gorm.DB, err error)
- func ParseTagSetting(str string, sep string) map[string]string
- func SelectCountSQL(tablename, key string) (sql string)
- func SpliceCondition(condition, str string) string
- type DB
- type GlobalMqttUser
- type Page
- type ReqPage
- type ReqPageUnRequired
Constants ¶
View Source
const ( IsEnable = 1 IsDisable = 2 )
View Source
const ( IsNotDelete = 0 IsDelete = 1 )
Variables ¶
View Source
var ( DBERROR = errors.New("数据库错误") DTNOFNDERROR = errors.New("数据不存在") )
View Source
var (
Gormdb *gorm.DB
)
Functions ¶
func GetFieldName ¶
func GetFieldName(filed reflect.StructField, tagName string) map[string]string
GetFieldName GetFieldName
func GetSelectSQL ¶
GetSelectSQL 获取修改sql
func GetSelectsLIMITSQL ¶
GetSelectsLIMITSQL 获取修改sql
func GetSelectsSQL ¶
GetSelectsSQL 获取修改sql
func SpliceCondition ¶
SpliceCondition 拼接Condition
Types ¶
type DB ¶
func GetSystemBeginOrm ¶
func GetSystemBeginOrm() (db *DB)
func GetSystemOrmDb ¶
func GetSystemOrmDb() (db *DB)
func (*DB) CreatMqttUserData ¶
func (db *DB) CreatMqttUserData(BusinessId int64) (data *GlobalMqttUser, err error)
func (*DB) FindCreatMqttUserData ¶
func (db *DB) FindCreatMqttUserData(BusinessId int64) (data *GlobalMqttUser, err error)
查找创建 BusinessId
func (*DB) GetUsernameMqttUserData ¶
func (db *DB) GetUsernameMqttUserData(username string) (data *GlobalMqttUser, err error)
通过用户查找数据
type GlobalMqttUser ¶
type GlobalMqttUser struct { BusinessId int64 `json:"business_id" gorm:"column:business_id;primaryKey"` //商户ID Username string `json:"username" gorm:"column:username"` //使用ddy做前缀+13为随机小写字母和数字 Password string `json:"password" gorm:"column:password"` //随机生成32位大小写数字的字符串 Remark string `json:"remark" gorm:"column:remark"` //备注信息 默认**创建 Status int `json:"status" gorm:"column:status"` //状态1:可用 2停用 CTime int64 `json:"c_time" gorm:"column:c_time"` //创建时间 }
type ReqPageUnRequired ¶
Click to show internal directories.
Click to hide internal directories.