feat: 考勤打卡模块(新方法论首个验证模块)

基于分析产出物开发(discovery-map考勤章节+baseline/05流程6):
- PunchFragment 3种状态(未上班/已上班/已下班)
- PunchApi 3个接口(getAttendance/onAndOffPunch/revokePunch)
- PunchStatus 数据类(字段名基于分析,非猜测)
- 上班打卡:蓝牙识别1.5s→确认弹窗→API
- 下班打卡:蓝牙识别1.5s→直接提交→低耗电模式
- 撤销打卡:确认弹窗→API→恢复
- 首页下拉手势→考勤页
- 蓝牙用模拟MAC,后续对接

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-04-28 18:34:36 +09:30
parent b7a1b2683f
commit c812b9ee1a
7 changed files with 509 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
package com.xiaoqu.watch.data.punch
import com.google.gson.annotations.SerializedName
/**
* 考勤状态数据类
* 对应 watchTask/myCurrentAttendance API 返回
* 来源discovery-map.md 考勤章节(已验证字段名)
*/
data class PunchStatus(
/** 上班打卡状态0=未上班, 1=已上班 */
@SerializedName("onPunchState") val onPunchState: Int = 0,
/** 下班打卡状态1=已下班, 其他=未下班 */
@SerializedName("offPunchState") val offPunchState: Int = 0
) {
/** 是否已上班 */
val isOnDuty: Boolean get() = onPunchState == 1
/** 是否已下班 */
val isOffDuty: Boolean get() = offPunchState == 1
}