package youngeetalentapi

import (
	"youngmini_server/app/service/youngee_talent_service"

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

var TalentAuthGetApi = talentAuthGetApi{}

type talentAuthGetApi struct{}

// 获取单个项目详情
func (*talentAuthGetApi) GetProjectDetail(r *ghttp.Request) {
	res := youngee_talent_service.GetProjectDetail(r)

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

// GetTalentInfo 获取达人信息
// youngee_talent_info、youngee_task_info
func (*talentAuthGetApi) GetTalentInfo(r *ghttp.Request) {
	res := youngee_talent_service.GetTalentInfo(r)
	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}

// GetTalentAddress 获取达人收货地址
// youngee_talent_delivery_address
func (*talentAuthGetApi) GetTalentAddress(r *ghttp.Request) {
	res := youngee_talent_service.GetTalentAddress(r)
	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}

// GetTalentAddress 获取单个达人收货地址详情
// youngee_talent_delivery_address
func (*talentAuthGetApi) GetSingleAddress(r *ghttp.Request) {
	res := youngee_talent_service.GetSingleAddress(r)
	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}

// GetTalentAddress 获取达人社媒账号
// youngee_platform_account_info
func (*talentAuthGetApi) GetTalentAccount(r *ghttp.Request) {
	res := youngee_talent_service.GetTalentAccount(r)
	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}

func (*talentAuthGetApi) IsLogin(r *ghttp.Request) {
	res := youngee_talent_service.IsLogin(r)
	err := r.Response.WriteJson(res)
	if err != nil {
		panic("write response error")
	}
}
