package youngeetalentapi

import (
	"youngmini_server/app/service/youngee_talent_service"

	"github.com/gogf/gf/net/ghttp"
)

var TalentAuthPostApi = talentAuthPostApi{}

type talentAuthPostApi struct{}

// TalentInfo 提交达人个人资料
func (*talentAuthPostApi) TalentInfo(r *ghttp.Request) {
	res := youngee_talent_service.OnPostTalentInfo(r)

	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}

// AddTalentAddress 添加达人收货地址
// youngee_talent_delivery_address
func (*talentAuthPostApi) AddTalentAddress(r *ghttp.Request) {
	res := youngee_talent_service.OnAddTalentAddress(r)
	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}

// UpdateTalentAddress 修改达人收货地址
// youngee_talent_delivery_address
func (*talentAuthPostApi) UpdateTalentAddress(r *ghttp.Request) {
	res := youngee_talent_service.OnUpdateTalentAddress(r)
	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}

// ChangeDefaultDeliveryAddr 修改默认收货地址
func (*talentAuthPostApi) ChangeDefaultDeliveryAddr(r *ghttp.Request) {
	res := youngee_talent_service.SetDefaultDeliveryAddr(r)
	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}

// DeleteTalentAddress 删除达人收货地址
// youngee_talent_delivery_address
func (*talentAuthPostApi) DeleteTalentAddress(r *ghttp.Request) {
	res := youngee_talent_service.OnDeleteTalentAddress(r)
	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}

// AddTalentAccount 添加达人社媒账号
// youngee_platform_account_info
func (*talentAuthPostApi) AddTalentAccount(r *ghttp.Request) {
	res := youngee_talent_service.OnAddTalentAccount(r)
	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}

// UpdateTalentAccount 修改达人社媒账号
// youngee_platform_account_info
func (*talentAuthPostApi) UpdateTalentAccount(r *ghttp.Request) {
	res := youngee_talent_service.OnUpdateTalentAccount(r)
	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}
