12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package user
- import "eta_mini_ht_api/models/user"
- type MetaInfoDTO struct {
- Uid string
- Meta string
- From string
- To string
- SourceType string
- MetaType string
- }
- func CreateMetaInfo(dto MetaInfoDTO) (err error) {
- return user.CreateMetaInfo(convertToMetaInfo(dto))
- }
- func convertToMetaInfo(dto MetaInfoDTO) user.MetaInfo {
- return user.MetaInfo{
- Uid: dto.Uid,
- Meta: dto.Meta,
- From: dto.From,
- To: dto.To,
- SourceType: user.SourceType(dto.SourceType),
- MetaType: user.MetaType(dto.MetaType),
- }
- }
- func convertToMetaDTO(dto user.MetaInfo) MetaInfoDTO {
- return MetaInfoDTO{
- Uid: dto.Uid,
- Meta: dto.Meta,
- From: dto.From,
- To: dto.To,
- SourceType: string(dto.SourceType),
- MetaType: string(dto.MetaType),
- }
- }
- func GetInitMetaInfos() (list []MetaInfoDTO) {
- metas := user.GetInitMetaInfos()
- for _, meta := range metas {
- list = append(list, convertToUserDTO())
- }
- }
|