love_php/README.txt

232 lines
8.4 KiB
Plaintext
Raw Normal View History

2026-04-02 09:20:51 +08:00
**福恋交友平台**
#version
* V2.4
#repos
* ufutx.love: 福恋基础库
* ufutx.love.admin: 福恋后台前端库
* ufutx.love.mp: 福恋小程序库
#域名主机配置
参考:[跨域配置](http://to-u.xyz/2016/06/30/nginx-cors/)
```nginx
add_header Access-Control-Allow-Origin *; //http://m.licaigou.com.cn;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;
location /mobile {
alias /var/www/mobile/release/mobile;
index index.html;
}
location /static {
alias /var/www/mobile/release/static;
index index.html;
}
```
# 网站安装
```
git clone git@repo.ufutx.net:ufutx.love
cd ufutx.love
composer update -vvv
cp .env.example .env
php artisan key:generate
## 后端初始化需要执行
# php artisan migrate:install
# php artisan migrate
php artisan passport:install
#linux/unix or mac
chmod 777 -R bootstrap/cache/ storage/logs/ storage/framework/ storage/app/
```
# 数据库
* user 用户信息
* mobile
* type: 用户类型: 单身signle, 介绍人marriage
* marriage_linkings: 介绍人人脉数
* single_male_linkings: 单身男
* single_female_linkings: 单身女
* request_num: 请求处理数量:1. 人脉请求 
* password_reset 重置密码
* wechat 微信信息
* message 验证码短信记录
* salary 薪水表:
* id
* min 区间最小值: null是以下
* max 区间最大值: null是以上
* text 薪水文本: 如3K-6K, 50K以上
* profile_courtship 单身资料: 求偎贴
* user_id:
* age: 年龄
* sex: 性别,从微信中获取
* state:单身状态:未婚,离异,丧偶
* stature: 身高按cm
* weight: 体重按Kg
* province: 省
* city: 城市
* resident_type: 户口
* resident_provice: 户口省份 
* resident_city: 户口城市 
* degree: 最高学历(大专,本科,硕士,博士, 其他)
* graduate_school: 毕业学校
* work_sort: 单位性质(事业单位,公务员,央企,国企,私企,外企)
* salary_id: 新水ID
* h_car: 有车
* h_housing: 有房
* introduction: 个人介绍(家庭情况,兴趣爱好,自我评价)
* ideal_mate: 理想伴侣(写下你对另一半的期望)
* photos: 生活照(PS,艺术照不受欢迎)(json数组,下同)
* graduate_photos: 毕业证
* identification_photos:身份证
* other_photots: 其他证件(注册会计师, 律师资格证等)
* wechat_id: 微信ID
* wechat_qrcode: 微信二维码
* profile_marriage 已婚资料:介绍人资料,后期婚恋状态里也会提供服务 
* user_id:
* company: 工作单位
* degree: 学历
* slogan: 服务格言: 乐意为单身的幸福生活服务
* wechat_id: 微信号
* wechat_qrcode: 微信二维码
* linking 人脉表: 互相确认关注后
* user_id: 用户id
* user_linking_id:用户人脉id
* linking_request 人脉请求:
* user_id: 用户id
* user_linking_id:用户人脉id
* status: 0: 请求 1: 已处理
* message:留言
* reply: 回复
* follow 关注与粉丝: 关注,订阅和赞,收藏
* profile_right 访问权限: 自定义资料访问权限
* user_id:
* profile_name
* type: 权限类型open: 公开, friend: 好友可见, right:特定条件, 参考right_id; user:仅用户可见
* right_id:
* right 权限定义: 好友及特定权限定义
* user_id:
* type: 类型:friend,right, user
* config: 权限配置
* friend: follow, fan, linking
* right: 以后再定义
* user: 用户id json数组
* 接口设计 
* 引导页:
* @POST:/api/login/wechat
* @desc: 服务器端登录
* @input: code: 微信用户登录凭证, 参考https://mp.weixin.qq.com/debug/wxadoc/dev/api/api-login.html#wxloginobject
* @output:
* user: 用户信息, 如未注册此信息为null
* user->register_status: 0:已完成(跳转到人脉), 1:等待完成第一步(单身第一步,介绍人资料填写 ) 2:等待完成第二步(单身第二步)
* token: 后期接口token
* @POST:/api/wechat/register
* @desc: 完成手机认证后调用此注册,同时完成登录
* @input:
* mobile 手机号.
* name: 姓名.
* wechat_code: 微信用户登录凭证.
* type: 用户类型.
* info: 小程序登录返回的res.userInfo
* from_openid: (从分享链接里获取)推荐人的openid, 可能没有
* @output:
* user: 用户信息
* token: 后期接口token
* 用户资料填写
* @PUT:/api/users/marrriage
* @desc: 修改介绍人资料
* @input:
* name: 姓名
* industry: 行业
* industry_sub: 子行业
* company: 工作单位
* degree: 学历
* slogan: 服务格言: 乐意为单身的幸福生活服务
* wechat_id: 微信号
* @get:/api/users/courtship/status
* @desc: 获取单身资料完成情况,没有完成提示还有哪些需要填写
* @PUT:/api/users/courtship/text
* @desc: 修改单身文件资料
* @input:
* name: 姓名
* industry: 行业
* industry_sub: 子行业
* state:单身状态:未婚,离异,丧偶
* stature: 身高按cm
* weight: 体重按Kg
* province: 省
* city: 城市
* resident_type: 户口
* resident_province: 户口省份 
* resident_city: 户口城市 
* degree: 最高学历(大专,本科,硕士,博士, 其他)
* graduate_school: 毕业学校
* work_sort: 单位性质(事业单位,公务员,央企,国企,私企,外企)
* salary_id: 新水ID
* h_car: 有车
* h_housing: 有房
* introduction: 个人介绍(家庭情况,兴趣爱好,自我评价)
* ideal_mate: 理想伴侣(写下你对另一半的期望)
* @PUT:/api/users/courtship/media
* @desc: 修改单身多媒体资料
* @input:
* photos: 生活照(PS,艺术照不受欢迎)(json数组,下同)
* graduate_photos: 毕业证
* identification_photos:身份证
* other_photos: 其他证件(注册会计师, 律师资格证等)
* wechat_qrcode: 微信二维码
*
* 人脉
* @GET: /api/linking
* @desc: 我的人脉详情
* @output:
* user: 用户信息
* user.wechat: 用户微信消息
* user.marriage: 介绍人的资料
* user.courtship:单身人的资料
* @GET: /api/users/{id}/linkings
* @desc 人脉列表
* @input:
* type: marriage|courtship
* sex: 男, 女
* @GET: /api/users/{id}
* @desc: 用户详情
* @output: 数据结构同/api/user
* @POST: /api/users/{id}/follow
* @desc: 关注用户(toggle), 关注了再调用会取消关注
* @POST: /api/users/{user_id}/linking
* @desc: 申请加入人脉
* @PUT: /api/linkings/{id}
* @desc: 同意申请人脉
* @DELETE: /api/linkings/{id}
* input:
@reply: 忽略原因
* @desc: 勿略人脉请求
* @DELETE: /api/users/{id}/linking
* @desc: 取消人脉
* 我的
* @GET: /api/user
* @desc: 我的
* @output:
* salaries
* user
* @GET: /api/linkings
* @desc: 我的人脉列表
* @input:
* status: 1: 已加入 0:待处理(default)
* @GET: /api/follows
* @desc: 我的关注
* 基础
* @GET: /api/industry/json
* 返回行业数据