123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <?php
- namespace App\Http\Controllers\Coach;
- use App\Http\Controllers\Controller;
- use App\Services\Coach\AccountService;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\Auth;
- /**
- * @group 技师端
- *
- * 技师账户相关的API接口
- */
- class AccountController extends Controller
- {
- protected AccountService $service;
- public function __construct(AccountService $service)
- {
- $this->service = $service;
- }
- /**
- * [账户]提交基本信息
- *
- * @description 提交技师的基本个人信息
- *
- * @authenticated
- *
- * @bodyParam nickname string required 昵称 Example: 张三
- * @bodyParam avatar string required 头像URL Example: http://example.com/avatar.jpg
- * @bodyParam gender string required 性别 Example: 1
- * @bodyParam mobile string required 手机号 Example: 13800138000
- * @bodyParam birthday date required 出生日期 Example: 1990-01-01
- * @bodyParam work_years integer required 工作年限 Example: 5
- * @bodyParam intention_city string required 意向城市 Example: 北京
- * @bodyParam introduction string required 个人简介 Example: 专业按摩师,从业5年
- *
- * @response {
- * "message": "基本信息提交成功"
- * }
- */
- public function submitBaseInfo(Request $request)
- {
- $data = $request->validate([
- 'nickname' => 'required|string|max:255',
- 'avatar' => 'required|url|max:255',
- 'gender' => 'required|string|max:255',
- 'mobile' => 'required|string|max:255',
- 'birthday' => 'required|date',
- 'work_years' => 'required|integer',
- 'intention_city' => 'required|string|max:255',
- 'introduction' => 'required|string|max:255',
- ]);
- return $this->service->submitBaseInfo(Auth::user()->id, $data);
- }
- /**
- * [账户]提交资质信息
- *
- * @description 提交技师的资质认证信息
- *
- * @authenticated
- *
- * @bodyParam qual_type string required 资质类型 Example: 高级按摩师
- * @bodyParam qual_no string required 资质证书编号 Example: XZ2024001
- * @bodyParam qual_photo string required 资质证书照片 Example: http://example.com/cert.jpg
- * @bodyParam valid_start date required 有效期开始日期 Example: 2024-01-01
- * @bodyParam valid_end date required 有效期结束日期 Example: 2029-01-01
- *
- * @response {
- * "message": "资质信息提交成功"
- * }
- */
- public function submitQualification(Request $request)
- {
- $data = $request->validate([
- 'qual_type' => 'required|string|max:255',
- 'qual_no' => 'required|string|max:255',
- 'qual_photo' => 'required|string|max:255|url',
- 'valid_start' => 'required|date',
- 'valid_end' => 'required|date|after:valid_start',
- ]);
- return $this->service->submitQualification(Auth::user()->id, $data);
- }
- /**
- * [账户]提交实名认证
- *
- * @description 提交技师的实名认证信息
- *
- * @authenticated
- *
- * @bodyParam real_name string required 姓名 Example: 张三
- * @bodyParam id_card string required 身份证号 Example: 370602199001011234
- * @bodyParam id_card_front_photo string required 身份证正面照片 Example: http://example.com/front.jpg
- * @bodyParam id_card_back_photo string required 身份证反面照片 Example: http://example.com/back.jpg
- * @bodyParam id_card_hand_photo string required 手持身份证照片 Example: http://example.com/hold.jpg
- *
- * @response {
- * "message": "实名认证信息提交成功"
- * }
- */
- public function submitRealName(Request $request)
- {
- $data = $request->validate([
- 'real_name' => 'required|string|max:50',
- 'id_card' => 'required|string|size:18',
- 'id_card_front_photo' => 'required|string|max:255|url',
- 'id_card_back_photo' => 'required|string|max:255|url',
- 'id_card_hand_photo' => 'required|string|max:255|url',
- ]);
- return $this->service->submitRealName(Auth::user()->id, $data);
- }
- }
|