Commit 8adfa0c5 authored by guxukai's avatar guxukai

chore: api迁移

parent 3e293122
import { Serializable } from 'typescript-json-serializer' import { Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios' import { api } from '@shared/http/axios'
@Serializable() @Serializable()
export class UserCodeGetReq {
target: string
type: string
}
@Serializable()
export class UserCode { export class UserCode {
/** /**
* 发送验证码 * 发送验证码
...@@ -17,3 +12,8 @@ export class UserCode { ...@@ -17,3 +12,8 @@ export class UserCode {
}) })
} }
} }
@Serializable()
export class UserCodeGetReq {
target: string
type: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer' import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios' import { api } from '@shared/http/axios'
import { Model } from '@shared/models/Model' import { Model } from '@shared/models/Model'
@Serializable()
export class UserPasswordPutReq extends Model<UserPasswordPutReq> {
@JsonProperty() password: string
@JsonProperty() phoneNum: string
@JsonProperty() verificode: string
}
@Serializable() @Serializable()
export class UserPassword extends Model<UserPassword> { export class UserPassword extends Model<UserPassword> {
static async put(payload: UserPasswordPutReq) { static async put(payload: UserPasswordPutReq) {
...@@ -16,3 +9,9 @@ export class UserPassword extends Model<UserPassword> { ...@@ -16,3 +9,9 @@ export class UserPassword extends Model<UserPassword> {
}) })
} }
} }
@Serializable()
export class UserPasswordPutReq extends Model<UserPasswordPutReq> {
@JsonProperty() password: string
@JsonProperty() phoneNum: string
@JsonProperty() verificode: string
}
...@@ -3,6 +3,14 @@ import { Model } from '@shared/models/Model' ...@@ -3,6 +3,14 @@ import { Model } from '@shared/models/Model'
import { api } from '@shared/http/axios' import { api } from '@shared/http/axios'
import { Encrypt } from '@shared/utils/secret-utils' import { Encrypt } from '@shared/utils/secret-utils'
@Serializable() @Serializable()
export class UserRegister {
static async post(payload: UserRegisterPostReq) {
return await api.post('/services/user-service/user/register', {
data: serialize(payload),
})
}
}
@Serializable()
export class UserRegisterPostReq extends Model<UserRegisterPostReq> { export class UserRegisterPostReq extends Model<UserRegisterPostReq> {
@JsonProperty() uname: string @JsonProperty() uname: string
@JsonProperty() mail: string @JsonProperty() mail: string
...@@ -16,11 +24,3 @@ export class UserRegisterPostReq extends Model<UserRegisterPostReq> { ...@@ -16,11 +24,3 @@ export class UserRegisterPostReq extends Model<UserRegisterPostReq> {
@JsonProperty() @JsonProperty()
verificode: string verificode: string
} }
@Serializable()
export class UserRegister {
static async post(payload: UserRegisterPostReq) {
return await api.post('/services/user-service/user/register', {
data: serialize(payload),
})
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment