package class import ( "git.sxidc.com/go-framework/baize/convenient/domain/operate_log" "git.sxidc.com/go-framework/baize/framework/core/domain" "git.sxidc.com/go-framework/baize/framework/core/domain/entity" ) const ( FieldName = "Name" FieldStudentNum = "StudentNum" ) var ( ColumnName = domain.ColumnName(FieldName) ColumnStudentNum = domain.ColumnName(FieldStudentNum) ) var fieldMap = map[string]string{ FieldName: "班名", FieldStudentNum: "学生数量", } type Entity struct { entity.Base Name string `sqlmapping:"column:name" sqlresult:"column:name" check:"required,lte=128,when=create/update"` StudentNum int `sqlmapping:"column:student_num;updateClear;" sqlresult:"column:student_num"` StudentIDs []string `sqlmapping:"-" sqlresult:"-"` entity.TimeFields } func (e *Entity) DomainCNName() string { return "班级" } func (e *Entity) DomainCamelName() string { return "Class" } func (e *Entity) GetFieldMap() map[string]string { return fieldMap } func (e *Entity) ObjectInfo() operate_log.ObjectInfo { return operate_log.ObjectInfo{ Resource: e.DomainCamelName(), ResourceID: e.ID, } } func (e *Entity) OperatorInfo() operate_log.OperatorInfo { return operate_log.OperatorInfo{} } func (e *Entity) LogContent() map[string]any { return map[string]any{ "name": e.Name, "student_num": e.StudentNum, } }