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:
20
app/src/main/java/com/xiaoqu/watch/data/punch/PunchStatus.kt
Normal file
20
app/src/main/java/com/xiaoqu/watch/data/punch/PunchStatus.kt
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user