package asUser type SexType string func (s SexType) ConvertInt() int { switch s { case "男": return 1 case "女": return 2 default: //其它 return 3 } }