code
stringlengths
1
1.05M
repo_name
stringlengths
6
83
path
stringlengths
3
242
language
stringclasses
222 values
license
stringclasses
20 values
size
int64
1
1.05M
package com.sky.dto; import lombok.Data; import java.io.Serializable; @Data public class DishPageQueryDTO implements Serializable { private int page; private int pageSize; private String name; //分类id private Integer categoryId; //状态 0表示禁用 1表示启用 private Integer status; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/DishPageQueryDTO.java
Java
unknown
332
package com.sky.dto; import lombok.Data; import java.io.Serializable; @Data public class EmployeeDTO implements Serializable { private Long id; private String username; private String name; private String phone; private String sex; private String idNumber; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/EmployeeDTO.java
Java
unknown
293
package com.sky.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; @Data @ApiModel(description = "员工登录时传递的数据模型") public class EmployeeLoginDTO implements Serializable { @ApiModelProperty("用户名") private String username; @ApiModelProperty("密码") private String password; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/EmployeeLoginDTO.java
Java
unknown
417
package com.sky.dto; import lombok.Data; import java.io.Serializable; @Data public class EmployeePageQueryDTO implements Serializable { //员工姓名 private String name; //页码 private int page; //每页显示记录数 private int pageSize; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/EmployeePageQueryDTO.java
Java
unknown
278
package com.sky.dto; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; @Data @AllArgsConstructor @NoArgsConstructor @Builder public class GoodsSalesDTO implements Serializable { //商品名称 private String name; //销量 private Integer number; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/GoodsSalesDTO.java
Java
unknown
358
package com.sky.dto; import lombok.Data; import java.io.Serializable; @Data public class OrdersCancelDTO implements Serializable { private Long id; //订单取消原因 private String cancelReason; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/OrdersCancelDTO.java
Java
unknown
217
package com.sky.dto; import lombok.Data; import java.io.Serializable; @Data public class OrdersConfirmDTO implements Serializable { private Long id; //订单状态 1待付款 2待接单 3 已接单 4 派送中 5 已完成 6 已取消 7 退款 private Integer status; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/OrdersConfirmDTO.java
Java
unknown
286
package com.sky.dto; import com.sky.entity.OrderDetail; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @Data public class OrdersDTO implements Serializable { private Long id; //订单号 private String number; //订单状态 1待付款,2待派送,3已派送,4已完成,5已取消 private Integer status; //下单用户id private Long userId; //地址id private Long addressBookId; //下单时间 private LocalDateTime orderTime; //结账时间 private LocalDateTime checkoutTime; //支付方式 1微信,2支付宝 private Integer payMethod; //实收金额 private BigDecimal amount; //备注 private String remark; //用户名 private String userName; //手机号 private String phone; //地址 private String address; //收货人 private String consignee; private List<OrderDetail> orderDetails; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/OrdersDTO.java
Java
unknown
1,025
package com.sky.dto; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.time.LocalDateTime; @Data public class OrdersPageQueryDTO implements Serializable { private int page; private int pageSize; private String number; private String phone; private Integer status; @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime beginTime; @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime endTime; private Long userId; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/OrdersPageQueryDTO.java
Java
unknown
574
package com.sky.dto; import lombok.Data; import java.io.Serializable; @Data public class OrdersPaymentDTO implements Serializable { //订单号 private String orderNumber; //付款方式 private Integer payMethod; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/OrdersPaymentDTO.java
Java
unknown
236
package com.sky.dto; import lombok.Data; import java.io.Serializable; @Data public class OrdersRejectionDTO implements Serializable { private Long id; //订单拒绝原因 private String rejectionReason; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/OrdersRejectionDTO.java
Java
unknown
224
package com.sky.dto; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; @Data public class OrdersSubmitDTO implements Serializable { //地址簿id private Long addressBookId; //付款方式 private int payMethod; //备注 private String remark; //预计送达时间 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime estimatedDeliveryTime; //配送状态 1立即送出 0选择具体时间 private Integer deliveryStatus; //餐具数量 private Integer tablewareNumber; //餐具数量状态 1按餐量提供 0选择具体数量 private Integer tablewareStatus; //打包费 private Integer packAmount; //总金额 private BigDecimal amount; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/OrdersSubmitDTO.java
Java
unknown
884
package com.sky.dto; import lombok.Data; import java.io.Serializable; @Data public class PasswordEditDTO implements Serializable { //员工id private Long empId; //旧密码 private String oldPassword; //新密码 private String newPassword; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/PasswordEditDTO.java
Java
unknown
275
package com.sky.dto; import com.sky.entity.SetmealDish; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @Data public class SetmealDTO implements Serializable { private Long id; //分类id private Long categoryId; //套餐名称 private String name; //套餐价格 private BigDecimal price; //状态 0:停用 1:启用 private Integer status; //描述信息 private String description; //图片 private String image; //套餐菜品关系 private List<SetmealDish> setmealDishes = new ArrayList<>(); }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/SetmealDTO.java
Java
unknown
651
package com.sky.dto; import lombok.Data; import java.io.Serializable; @Data public class SetmealPageQueryDTO implements Serializable { private int page; private int pageSize; private String name; //分类id private Integer categoryId; //状态 0表示禁用 1表示启用 private Integer status; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/SetmealPageQueryDTO.java
Java
unknown
335
package com.sky.dto; import lombok.Data; import java.io.Serializable; @Data public class ShoppingCartDTO implements Serializable { private Long dishId; private Long setmealId; private String dishFlavor; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/ShoppingCartDTO.java
Java
unknown
221
package com.sky.dto; import lombok.Data; import java.io.Serializable; /** * C端用户登录 */ @Data public class UserLoginDTO implements Serializable { private String code; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/dto/UserLoginDTO.java
Java
unknown
188
package com.sky.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 地址簿 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class AddressBook implements Serializable { private static final long serialVersionUID = 1L; private Long id; //用户id private Long userId; //收货人 private String consignee; //手机号 private String phone; //性别 0 女 1 男 private String sex; //省级区划编号 private String provinceCode; //省级名称 private String provinceName; //市级区划编号 private String cityCode; //市级名称 private String cityName; //区级区划编号 private String districtCode; //区级名称 private String districtName; //详细地址 private String detail; //标签 private String label; //是否默认 0否 1是 private Integer isDefault; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/entity/AddressBook.java
Java
unknown
1,027
package com.sky.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.time.LocalDateTime; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class Category implements Serializable { private static final long serialVersionUID = 1L; private Long id; //类型: 1菜品分类 2套餐分类 private Integer type; //分类名称 private String name; //顺序 private Integer sort; //分类状态 0标识禁用 1表示启用 private Integer status; //创建时间 private LocalDateTime createTime; //更新时间 private LocalDateTime updateTime; //创建人 private Long createUser; //修改人 private Long updateUser; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/entity/Category.java
Java
unknown
815
package com.sky.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; /** * 菜品 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class Dish implements Serializable { private static final long serialVersionUID = 1L; private Long id; //菜品名称 private String name; //菜品分类id private Long categoryId; //菜品价格 private BigDecimal price; //图片 private String image; //描述信息 private String description; //0 停售 1 起售 private Integer status; private LocalDateTime createTime; private LocalDateTime updateTime; private Long createUser; private Long updateUser; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/entity/Dish.java
Java
unknown
850
package com.sky.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 菜品口味 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class DishFlavor implements Serializable { private static final long serialVersionUID = 1L; private Long id; //菜品id private Long dishId; //口味名称 private String name; //口味数据list private String value; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/entity/DishFlavor.java
Java
unknown
508
package com.sky.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.time.LocalDateTime; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class Employee implements Serializable { private static final long serialVersionUID = 1L; private Long id; private String username; private String name; private String password; private String phone; private String sex; private String idNumber; private Integer status; //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTime; //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime updateTime; private Long createUser; private Long updateUser; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/entity/Employee.java
Java
unknown
816
package com.sky.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; /** * 订单明细 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class OrderDetail implements Serializable { private static final long serialVersionUID = 1L; private Long id; //名称 private String name; //订单id private Long orderId; //菜品id private Long dishId; //套餐id private Long setmealId; //口味 private String dishFlavor; //数量 private Integer number; //金额 private BigDecimal amount; //图片 private String image; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/entity/OrderDetail.java
Java
unknown
740
package com.sky.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; /** * 订单 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class Orders implements Serializable { /** * 订单状态 1待付款 2待接单 3已接单 4派送中 5已完成 6已取消 */ public static final Integer PENDING_PAYMENT = 1; public static final Integer TO_BE_CONFIRMED = 2; public static final Integer CONFIRMED = 3; public static final Integer DELIVERY_IN_PROGRESS = 4; public static final Integer COMPLETED = 5; public static final Integer CANCELLED = 6; /** * 支付状态 0未支付 1已支付 2退款 */ public static final Integer UN_PAID = 0; public static final Integer PAID = 1; public static final Integer REFUND = 2; private static final long serialVersionUID = 1L; private Long id; //订单号 private String number; //订单状态 1待付款 2待接单 3已接单 4派送中 5已完成 6已取消 7退款 private Integer status; //下单用户id private Long userId; //地址id private Long addressBookId; //下单时间 private LocalDateTime orderTime; //结账时间 private LocalDateTime checkoutTime; //支付方式 1微信,2支付宝 private Integer payMethod; //支付状态 0未支付 1已支付 2退款 private Integer payStatus; //实收金额 private BigDecimal amount; //备注 private String remark; //用户名 private String userName; //手机号 private String phone; //地址 private String address; //收货人 private String consignee; //订单取消原因 private String cancelReason; //订单拒绝原因 private String rejectionReason; //订单取消时间 private LocalDateTime cancelTime; //预计送达时间 private LocalDateTime estimatedDeliveryTime; //配送状态 1立即送出 0选择具体时间 private Integer deliveryStatus; //送达时间 private LocalDateTime deliveryTime; //打包费 private int packAmount; //餐具数量 private int tablewareNumber; //餐具数量状态 1按餐量提供 0选择具体数量 private Integer tablewareStatus; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/entity/Orders.java
Java
unknown
2,442
package com.sky.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; /** * 套餐 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class Setmeal implements Serializable { private static final long serialVersionUID = 1L; private Long id; //分类id private Long categoryId; //套餐名称 private String name; //套餐价格 private BigDecimal price; //状态 0:停用 1:启用 private Integer status; //描述信息 private String description; //图片 private String image; private LocalDateTime createTime; private LocalDateTime updateTime; private Long createUser; private Long updateUser; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/entity/Setmeal.java
Java
unknown
853
package com.sky.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; /** * 套餐菜品关系 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class SetmealDish implements Serializable { private static final long serialVersionUID = 1L; private Long id; //套餐id private Long setmealId; //菜品id private Long dishId; //菜品名称 (冗余字段) private String name; //菜品原价 private BigDecimal price; //份数 private Integer copies; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/entity/SetmealDish.java
Java
unknown
649
package com.sky.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; /** * 购物车 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class ShoppingCart implements Serializable { private static final long serialVersionUID = 1L; private Long id; //名称 private String name; //用户id private Long userId; //菜品id private Long dishId; //套餐id private Long setmealId; //口味 private String dishFlavor; //数量 private Integer number; //金额 private BigDecimal amount; //图片 private String image; private LocalDateTime createTime; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/entity/ShoppingCart.java
Java
unknown
808
package com.sky.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.time.LocalDate; import java.time.LocalDateTime; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class User implements Serializable { private static final long serialVersionUID = 1L; private Long id; //微信用户唯一标识 private String openid; //姓名 private String name; //手机号 private String phone; //性别 0 女 1 男 private String sex; //身份证号 private String idNumber; //头像 private String avatar; //注册时间 private LocalDateTime createTime; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/entity/User.java
Java
unknown
741
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 数据概览 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class BusinessDataVO implements Serializable { private Double turnover;//营业额 private Integer validOrderCount;//有效订单数 private Double orderCompletionRate;//订单完成率 private Double unitPrice;//平均客单价 private Integer newUsers;//新增用户数 }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/BusinessDataVO.java
Java
unknown
547
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class DishItemVO implements Serializable { //菜品名称 private String name; //份数 private Integer copies; //菜品图片 private String image; //菜品描述 private String description; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/DishItemVO.java
Java
unknown
453
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 菜品总览 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class DishOverViewVO implements Serializable { // 已启售数量 private Integer sold; // 已停售数量 private Integer discontinued; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/DishOverViewVO.java
Java
unknown
403
package com.sky.vo; import com.sky.entity.DishFlavor; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class DishVO implements Serializable { private Long id; //菜品名称 private String name; //菜品分类id private Long categoryId; //菜品价格 private BigDecimal price; //图片 private String image; //描述信息 private String description; //0 停售 1 起售 private Integer status; //更新时间 private LocalDateTime updateTime; //分类名称 private String categoryName; //菜品关联的口味 private List<DishFlavor> flavors = new ArrayList<>(); //private Integer copies; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/DishVO.java
Java
unknown
942
package com.sky.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; @Data @Builder @NoArgsConstructor @AllArgsConstructor @ApiModel(description = "员工登录返回的数据格式") public class EmployeeLoginVO implements Serializable { @ApiModelProperty("主键值") private Long id; @ApiModelProperty("用户名") private String userName; @ApiModelProperty("姓名") private String name; @ApiModelProperty("jwt令牌") private String token; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/EmployeeLoginVO.java
Java
unknown
665
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 订单概览数据 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class OrderOverViewVO implements Serializable { //待接单数量 private Integer waitingOrders; //待派送数量 private Integer deliveredOrders; //已完成数量 private Integer completedOrders; //已取消数量 private Integer cancelledOrders; //全部订单 private Integer allOrders; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/OrderOverViewVO.java
Java
unknown
591
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.time.LocalDateTime; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class OrderPaymentVO implements Serializable { private String nonceStr; //随机字符串 private String paySign; //签名 private String timeStamp; //时间戳 private String signType; //签名算法 private String packageStr; //统一下单接口返回的 prepay_id 参数值 }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/OrderPaymentVO.java
Java
unknown
557
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class OrderReportVO implements Serializable { //日期,以逗号分隔,例如:2022-10-01,2022-10-02,2022-10-03 private String dateList; //每日订单数,以逗号分隔,例如:260,210,215 private String orderCountList; //每日有效订单数,以逗号分隔,例如:20,21,10 private String validOrderCountList; //订单总数 private Integer totalOrderCount; //有效订单数 private Integer validOrderCount; //订单完成率 private Double orderCompletionRate; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/OrderReportVO.java
Java
unknown
763
package com.sky.vo; import lombok.Data; import java.io.Serializable; @Data public class OrderStatisticsVO implements Serializable { //待接单数量 private Integer toBeConfirmed; //待派送数量 private Integer confirmed; //派送中数量 private Integer deliveryInProgress; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/OrderStatisticsVO.java
Java
unknown
310
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class OrderSubmitVO implements Serializable { //订单id private Long id; //订单号 private String orderNumber; //订单金额 private BigDecimal orderAmount; //下单时间 private LocalDateTime orderTime; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/OrderSubmitVO.java
Java
unknown
527
package com.sky.vo; import com.sky.entity.OrderDetail; import com.sky.entity.Orders; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; @Data @NoArgsConstructor @AllArgsConstructor public class OrderVO extends Orders implements Serializable { //订单菜品信息 private String orderDishes; //订单详情 private List<OrderDetail> orderDetailList; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/OrderVO.java
Java
unknown
461
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class SalesTop10ReportVO implements Serializable { //商品名称列表,以逗号分隔,例如:鱼香肉丝,宫保鸡丁,水煮鱼 private String nameList; //销量列表,以逗号分隔,例如:260,215,200 private String numberList; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/SalesTop10ReportVO.java
Java
unknown
489
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 套餐总览 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class SetmealOverViewVO implements Serializable { // 已启售数量 private Integer sold; // 已停售数量 private Integer discontinued; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/SetmealOverViewVO.java
Java
unknown
406
package com.sky.vo; import com.sky.entity.SetmealDish; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class SetmealVO implements Serializable { private Long id; //分类id private Long categoryId; //套餐名称 private String name; //套餐价格 private BigDecimal price; //状态 0:停用 1:启用 private Integer status; //描述信息 private String description; //图片 private String image; //更新时间 private LocalDateTime updateTime; //分类名称 private String categoryName; //套餐和菜品的关联关系 private List<SetmealDish> setmealDishes = new ArrayList<>(); }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/SetmealVO.java
Java
unknown
941
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class TurnoverReportVO implements Serializable { //日期,以逗号分隔,例如:2022-10-01,2022-10-02,2022-10-03 private String dateList; //营业额,以逗号分隔,例如:406.0,1520.0,75.0 private String turnoverList; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/TurnoverReportVO.java
Java
unknown
477
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class UserLoginVO implements Serializable { private Long id; private String openid; private String token; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/UserLoginVO.java
Java
unknown
345
package com.sky.vo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class UserReportVO implements Serializable { //日期,以逗号分隔,例如:2022-10-01,2022-10-02,2022-10-03 private String dateList; //用户总量,以逗号分隔,例如:200,210,220 private String totalUserList; //新增用户,以逗号分隔,例如:20,21,10 private String newUserList; }
2301_80211016/cqwm
sky-pojo/src/main/java/com/sky/vo/UserReportVO.java
Java
unknown
561
package com.sky; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.web.bind.annotation.GetMapping; @SpringBootApplication @EnableTransactionManagement //开启注解方式的事务管理 @Slf4j public class SkyApplication { public static void main(String[] args) { SpringApplication.run(SkyApplication.class, args); log.info("server started"); } @GetMapping("/main-test") public String mainTest() { System.out.println("!!! 主类测试接口被调用 !!!"); return "Main Test OK"; } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/SkyApplication.java
Java
unknown
751
package com.sky.annotation; import com.sky.enumeration.OperationType; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface AutoFill { OperationType value(); }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/annotation/AutoFill.java
Java
unknown
357
package com.sky.aspect; import com.sky.annotation.AutoFill; import com.sky.constant.AutoFillConstant; import com.sky.context.BaseContext; import com.sky.enumeration.OperationType; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; import org.springframework.stereotype.Component; import org.aspectj.lang.reflect.MethodSignature; import java.time.LocalDateTime; @Aspect @Component @Slf4j public class AutoFillAspect { @Pointcut("execution(* com.sky.mapper.*.*(..)) && @annotation(com.sky.annotation.AutoFill)") public void autoFillPointCut( ) { } @Before("autoFillPointCut()") public void AutoFill(JoinPoint joinPoint ) { log.info("开始进行公共字段填充---"); //获得到当前被拦截方法上数据库操作类型 MethodSignature signature = (MethodSignature) joinPoint.getSignature();//方法签名对象 AutoFill autoFill = signature.getMethod().getAnnotation(AutoFill.class);//获得方法上的注解对象 OperationType operationType = autoFill.value();//获得数据库操作类型 //获取到当前被拦截的方法参数--实体对象 Object[] args = joinPoint.getArgs(); if (args == null || args.length == 0) { return; } Object entry = args[0]; //准备赋值的数据 LocalDateTime now = LocalDateTime.now(); Long currentId = BaseContext.getCurrentId(); //根据当前不同的操作类型,为对应的属性通过反射来赋值 if (operationType == OperationType.INSERT) { try { entry.getClass().getDeclaredMethod(AutoFillConstant.SET_UPDATE_TIME, LocalDateTime.class).invoke(entry, now); entry.getClass().getDeclaredMethod(AutoFillConstant.SET_UPDATE_USER, Long.class).invoke(entry, currentId); entry.getClass().getDeclaredMethod(AutoFillConstant.SET_CREATE_TIME, LocalDateTime.class).invoke(entry, now); entry.getClass().getDeclaredMethod(AutoFillConstant.SET_CREATE_USER, Long.class).invoke(entry, currentId); } catch (Exception e) { e.printStackTrace(); } } if (operationType == OperationType.UPDATE) { try { entry.getClass().getDeclaredMethod(AutoFillConstant.SET_UPDATE_TIME, LocalDateTime.class).invoke(entry, now); entry.getClass().getDeclaredMethod(AutoFillConstant.SET_UPDATE_USER, Long.class).invoke(entry, currentId); } catch (Exception e) { e.printStackTrace(); } } } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/aspect/AutoFillAspect.java
Java
unknown
2,794
package com.sky.config; import com.aliyun.oss.internal.OSSUtils; import com.sky.properties.AliOssProperties; import com.sky.utils.AliOssUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Slf4j @Configuration public class OssConfiguration { @Bean @ConditionalOnMissingBean public AliOssUtil aliOssUtil(AliOssProperties aliOssProperties) { log.info("开始创建阿里云文件上传客户端:{}", aliOssProperties); return new AliOssUtil(aliOssProperties.getEndpoint(), aliOssProperties.getAccessKeyId(), aliOssProperties.getAccessKeySecret(), aliOssProperties.getBucketName()); } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/config/OssConfiguration.java
Java
unknown
851
package com.sky.config; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.StringRedisSerializer; @Configuration @Slf4j public class RedisConfiguration { @Bean public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory){ log.info("开始创建RedisTemplate对象..."); //创建RedisTemplate对象 RedisTemplate redisTemplate = new RedisTemplate(); //设置RedisConnectionFactory redisTemplate.setConnectionFactory(redisConnectionFactory); //设置key的序列化方式 redisTemplate.setKeySerializer(new StringRedisSerializer()); //设置value的序列化方式 // redisTemplate.setValueSerializer(new StringRedisSerializer()); return redisTemplate; } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/config/RedisConfiguration.java
Java
unknown
1,052
package com.sky.config; import com.sky.interceptor.JwtTokenAdminInterceptor; import com.sky.json.JacksonObjectMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import java.util.List; /** * 配置类,注册web层相关组件 */ @Configuration @Slf4j public class WebMvcConfiguration extends WebMvcConfigurationSupport { @Autowired private JwtTokenAdminInterceptor jwtTokenAdminInterceptor; /** * 注册自定义拦截器 * * @param registry */ protected void addInterceptors(InterceptorRegistry registry) { log.info("开始注册自定义拦截器..."); registry.addInterceptor(jwtTokenAdminInterceptor) .addPathPatterns("/admin/**") .excludePathPatterns("/admin/employee/login"); } /** * 通过knife4j生成接口文档 * @return */ @Bean public Docket docket() { ApiInfo apiInfo = new ApiInfoBuilder() .title("苍穹外卖项目接口文档") .version("2.0") .description("苍穹外卖项目接口文档") .build(); Docket docket = new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo) .select() .apis(RequestHandlerSelectors.basePackage("com.sky.controller")) .paths(PathSelectors.any()) .build(); return docket; } /** * 设置静态资源映射 * @param registry */ protected void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); } @Override protected void extendMessageConverters(List<HttpMessageConverter<?>> converters) { log.info("扩展消息转换器..."); //创建一个消息转换器对象 MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); //需要为消息转换器设置一个对象转换器,对象转换器可以将Java对象序列号为json数据 converter.setObjectMapper(new JacksonObjectMapper()); //将自己的消息转化器加入到容器中 converters.add(0,converter); } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/config/WebMvcConfiguration.java
Java
unknown
3,264
package com.sky.controller.admin; import com.sky.dto.CategoryDTO; import com.sky.dto.CategoryPageQueryDTO; import com.sky.entity.Category; import com.sky.result.PageResult; import com.sky.result.Result; import com.sky.service.CategoryService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; /** * 分类管理 */ @RestController @RequestMapping("/admin/category") @Api(tags = "分类相关接口") @Slf4j public class CategoryController { @Autowired private CategoryService categoryService; /** * 新增分类 * @param categoryDTO * @return */ @PostMapping @ApiOperation("新增分类") public Result<String> save(@RequestBody CategoryDTO categoryDTO){ log.info("新增分类:{}", categoryDTO); categoryService.save(categoryDTO); return Result.success(); } /** * 分类分页查询 * @param categoryPageQueryDTO * @return */ @GetMapping("/page") @ApiOperation("分类分页查询") public Result<PageResult> page(CategoryPageQueryDTO categoryPageQueryDTO){ log.info("分页查询:{}", categoryPageQueryDTO); PageResult pageResult = categoryService.pageQuery(categoryPageQueryDTO); return Result.success(pageResult); } /** * 删除分类 * @param id * @return */ @DeleteMapping @ApiOperation("删除分类") public Result<String> deleteById(Long id){ log.info("删除分类:{}", id); categoryService.deleteById(id); return Result.success(); } /** * 修改分类 * @param categoryDTO * @return */ @PutMapping @ApiOperation("修改分类") public Result<String> update(@RequestBody CategoryDTO categoryDTO){ categoryService.update(categoryDTO); return Result.success(); } /** * 启用、禁用分类 * @param status * @param id * @return */ @PostMapping("/status/{status}") @ApiOperation("启用禁用分类") public Result<String> startOrStop(@PathVariable("status") Integer status, Long id){ categoryService.startOrStop(status,id); return Result.success(); } /** * 根据类型查询分类 * @param type * @return */ @GetMapping("/list") @ApiOperation("根据类型查询分类") public Result<List<Category>> list(Integer type){ List<Category> list = categoryService.list(type); return Result.success(list); } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/controller/admin/CategoryController.java
Java
unknown
2,703
package com.sky.controller.admin; import com.sky.constant.MessageConstant; import com.sky.result.Result; import com.sky.utils.AliOssUtil; import lombok.extern.slf4j.Slf4j; import org.aspectj.bridge.Message; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.nio.channels.MulticastChannel; import java.util.UUID; @RestController @RequestMapping("/admin/common") @Slf4j public class CommonController { @Autowired private AliOssUtil aliOssUtil; //文件上传 @PostMapping("/upload") public Result<String> upload(MultipartFile file){ log.info("文件上传:{}",file); try { String originlFileName = file.getOriginalFilename(); String exention = originlFileName.substring(originlFileName.lastIndexOf(".")); String objectName = UUID.randomUUID().toString() + exention; String filePath = aliOssUtil.upload(file.getBytes(), objectName); return Result.success(filePath); } catch (IOException e) { log.error("文件上传失败:{}",e); } return Result.error(MessageConstant.UPLOAD_FAILED); } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/controller/admin/CommonController.java
Java
unknown
1,432
package com.sky.controller.admin; import com.sky.dto.DishDTO; import com.sky.dto.DishPageQueryDTO; import com.sky.result.PageResult; import com.sky.result.Result; import com.sky.service.DishService; import com.sky.vo.DishVO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/admin/dish") @Slf4j public class DishController { @Autowired private DishService dishService; /** * 新增菜品 * @param dishDTO * @return */ @PostMapping public Result save(@RequestBody DishDTO dishDTO) { log.info("新增菜品:{}", dishDTO); dishService.saveWithFlavor(dishDTO); return Result.success(); } /** * 菜品分页查询 * @param dishPageQueryDTO * @return */ @GetMapping("/page") public Result<PageResult> page(DishPageQueryDTO dishPageQueryDTO){ log.info("菜品分页查询:{}", dishPageQueryDTO); PageResult pageResult = dishService.pageQuery(dishPageQueryDTO); return Result.success(pageResult); } /** * 批量删除菜品 * @param ids * @return */ @DeleteMapping public Result delete(@RequestParam List<Long> ids){ log.info("批量删除菜品:{}", ids); dishService.deleteBatch(ids); return Result.success(); } /** * 根据id查询菜品和对应的口味 * @param id * @return */ @GetMapping("/{id}") public Result<DishVO> getById(@PathVariable Long id){ log.info("根据id查询菜品和口味:{}", id); DishVO dishVO = dishService.getByIdWithFlavor(id); return Result.success(dishVO); } /** * 修改菜品 * @param dishDTO * @return */ @PutMapping public Result update(@RequestBody DishDTO dishDTO){ log.info("编辑菜品:{}", dishDTO); dishService.updateWithFlavor(dishDTO); return Result.success(); } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/controller/admin/DishController.java
Java
unknown
2,094
package com.sky.controller.admin; import com.sky.constant.JwtClaimsConstant; import com.sky.dto.EmployeeDTO; import com.sky.dto.EmployeeLoginDTO; import com.sky.dto.EmployeePageQueryDTO; import com.sky.entity.Employee; import com.sky.properties.JwtProperties; import com.sky.result.PageResult; import com.sky.result.Result; import com.sky.service.EmployeeService; import com.sky.utils.JwtUtil; import com.sky.vo.DishVO; import com.sky.vo.EmployeeLoginVO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.HashMap; import java.util.Map; /** * 员工管理 */ @RestController @RequestMapping("/admin/employee") @Slf4j public class EmployeeController { @Autowired private EmployeeService employeeService; @Autowired private JwtProperties jwtProperties; /** * 登录 * * @param employeeLoginDTO * @return */ @PostMapping("/login") public Result<EmployeeLoginVO> login(@RequestBody EmployeeLoginDTO employeeLoginDTO) { log.info("员工登录:{}", employeeLoginDTO); Employee employee = employeeService.login(employeeLoginDTO); //登录成功后,生成jwt令牌 Map<String, Object> claims = new HashMap<>(); claims.put(JwtClaimsConstant.EMP_ID, employee.getId()); String token = JwtUtil.createJWT( jwtProperties.getAdminSecretKey(), jwtProperties.getAdminTtl(), claims); EmployeeLoginVO employeeLoginVO = EmployeeLoginVO.builder() .id(employee.getId()) .userName(employee.getUsername()) .name(employee.getName()) .token(token) .build(); return Result.success(employeeLoginVO); } /** * 退出 * * @return */ @PostMapping("/logout") public Result<String> logout() { return Result.success(); } @PostMapping public Result save(@RequestBody EmployeeDTO employeeDTO) { log.info("新增员工:{}", employeeDTO); employeeService.save(employeeDTO); return Result.success(); } //分页查询 @GetMapping("/page") public Result<PageResult> page(EmployeePageQueryDTO employeePageQueryDTO) { log.info("员工分页查询,参数为:{}", employeePageQueryDTO); PageResult pageResult = employeeService.pageQuery(employeePageQueryDTO); return Result.success(pageResult); } //启用禁用员工账号 @PostMapping("/status/{status}") public Result startOrStop(@PathVariable Integer status,Long id) { log.info("启用禁用员工账号:{},{}",status,id); employeeService.startOrStop(status,id); return Result.success(); } //通过id查询员工 @GetMapping("/{id}") public Result<Employee> getById(@PathVariable Long id) { Employee employee = employeeService.getById(id); return Result.success(employee); } @PutMapping public Result update(@RequestBody EmployeeDTO employeeDTO) { log.info("编辑员工信息:{}", employeeDTO); employeeService.update(employeeDTO); return Result.success(); } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/controller/admin/EmployeeController.java
Java
unknown
3,312
package com.sky.controller.admin; import com.sky.result.Result; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.web.bind.annotation.*; @RestController("adminShopController") @RequestMapping("/admin/shop") @Slf4j public class ShopController { public static final String KEY = "SHOP_STATUS"; @Autowired private RedisTemplate redisTemplate; /** * 设置营业状态 * @param status * @return */ @PutMapping("/{status}") public Result setStatus(@PathVariable Integer status) { log.info("设置店铺营业状态:{}",status == 1 ? "营业中" : "打烊中"); redisTemplate.opsForValue().set(KEY,status); return Result.success(); } /** * 获取营业状态 * @return */ @GetMapping("/status") public Result<Integer> getStatus() { Integer Status = (Integer) redisTemplate.opsForValue().get(KEY); log.info("获取店铺营业状态:{}",Status == 1 ? "营业中" : "打烊中"); return Result.success(Status); } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/controller/admin/ShopController.java
Java
unknown
1,178
package com.sky.controller.user; import com.sky.result.Result; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.web.bind.annotation.*; @RestController("userShopController") @RequestMapping("/user/shop") @Slf4j public class ShopController { public static final String KEY = "SHOP_STATUS"; @Autowired private RedisTemplate redisTemplate; /** * 获取营业状态 * @return */ @GetMapping("/status") public Result<Integer> getStatus() { Integer Status = (Integer) redisTemplate.opsForValue().get(KEY); log.info("获取店铺营业状态:{}",Status == 1 ? "营业中" : "打烊中"); return Result.success(Status); } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/controller/user/ShopController.java
Java
unknown
827
package com.sky.handler; import com.sky.constant.MessageConstant; import com.sky.exception.BaseException; import com.sky.result.Result; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; import java.sql.SQLIntegrityConstraintViolationException; /** * 全局异常处理器,处理项目中抛出的业务异常 */ @RestControllerAdvice @Slf4j public class GlobalExceptionHandler { /** * 捕获业务异常 * @param ex * @return */ @ExceptionHandler public Result exceptionHandler(BaseException ex){ log.error("异常信息:{}", ex.getMessage()); return Result.error(ex.getMessage()); } @ExceptionHandler public Result exceptionHandler(SQLIntegrityConstraintViolationException ex){ //Duplicate entry 'fgd' for key 'employee.idx_username' String message = ex.getMessage(); if (message.contains("Duplicate entry")){ String[] split = message.split(" "); String name = split[2]; String msg = name+ "已存在"; return Result.error(msg); }else { return Result.error(MessageConstant.UNKNOWN_ERROR); } } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/handler/GlobalExceptionHandler.java
Java
unknown
1,294
package com.sky.interceptor; import com.sky.constant.JwtClaimsConstant; import com.sky.context.BaseContext; import com.sky.properties.JwtProperties; import com.sky.utils.JwtUtil; import io.jsonwebtoken.Claims; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * jwt令牌校验的拦截器 */ @Component @Slf4j public class JwtTokenAdminInterceptor implements HandlerInterceptor { @Autowired private JwtProperties jwtProperties; /** * 校验jwt * * @param request * @param response * @param handler * @return * @throws Exception */ public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { //判断当前拦截到的是Controller的方法还是其他资源 if (!(handler instanceof HandlerMethod)) { //当前拦截到的不是动态方法,直接放行 return true; } //1、从请求头中获取令牌 String token = request.getHeader(jwtProperties.getAdminTokenName()); //2、校验令牌 try { log.info("jwt校验:{}", token); Claims claims = JwtUtil.parseJWT(jwtProperties.getAdminSecretKey(), token); Long empId = Long.valueOf(claims.get(JwtClaimsConstant.EMP_ID).toString()); log.info("当前员工id:{}", empId); BaseContext.setCurrentId(empId); //3、通过,放行 return true; } catch (Exception ex) { //4、不通过,响应401状态码 response.setStatus(401); return false; } } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/interceptor/JwtTokenAdminInterceptor.java
Java
unknown
1,946
package com.sky.mapper; import com.github.pagehelper.Page; import com.sky.enumeration.OperationType; import com.sky.dto.CategoryPageQueryDTO; import com.sky.entity.Category; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper public interface CategoryMapper { /** * 插入数据 * @param category */ @Insert("insert into category(type, name, sort, status, create_time, update_time, create_user, update_user)" + " VALUES" + " (#{type}, #{name}, #{sort}, #{status}, #{createTime}, #{updateTime}, #{createUser}, #{updateUser})") void insert(Category category); /** * 分页查询 * @param categoryPageQueryDTO * @return */ Page<Category> pageQuery(CategoryPageQueryDTO categoryPageQueryDTO); /** * 根据id删除分类 * @param id */ @Delete("delete from category where id = #{id}") void deleteById(Long id); /** * 根据id修改分类 * @param category */ void update(Category category); /** * 根据类型查询分类 * @param type * @return */ List<Category> list(Integer type); }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/mapper/CategoryMapper.java
Java
unknown
1,259
package com.sky.mapper; import com.sky.entity.DishFlavor; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import java.util.List; @Mapper public interface DishFlavorMapper { /** * 批量插入口味数据 * @param flavors */ void insertBatch(List<DishFlavor> flavors); // 根据菜品id删除口味数据 @Delete("delete from dish_flavor where dish_id = #{id}") void deleteByDishId(Long id); /** * 根据菜品id集合批量删除口味 数据 * @param dishIds */ void deleteByDishIds(List<Long> dishIds); /** * 根据菜品id查询口味数据 * @param id * @return */ @Select("select * from dish_flavor where dish_id = #{id}") List<DishFlavor> getByDishId(Long id); }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/mapper/DishFlavorMapper.java
Java
unknown
860
package com.sky.mapper; import com.github.pagehelper.Page; import com.sky.annotation.AutoFill; import com.sky.dto.DishPageQueryDTO; import com.sky.entity.Dish; import com.sky.enumeration.OperationType; import com.sky.vo.DishVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import java.util.List; @Mapper public interface DishMapper { /** * 根据分类id查询菜品数量 * @param categoryId * @return */ @Select("select count(id) from dish where category_id = #{categoryId}") Integer countByCategoryId(Long categoryId); @AutoFill(value = OperationType.INSERT) void insert(Dish dish); // 菜品分页查询 Page<DishVO> pageQuery(DishPageQueryDTO dishPageQueryDTO); // 根据id查询菜品和对应的口味数据 @Select("select * from dish where id = #{id}") Dish getById(Long id); // 根据id删除菜品数据 @Select("delete from dish where id = #{id}") void deleteById(Long id); /* 根据菜品id集合批量删除菜品数据 * @param ids */ void deleteByIds(List<Long> ids); /** * 修改菜品 * @param dish * @return */ @AutoFill(value = OperationType.UPDATE) void update(Dish dish); }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/mapper/DishMapper.java
Java
unknown
1,299
package com.sky.mapper; import com.github.pagehelper.Page; import com.sky.annotation.AutoFill; import com.sky.dto.EmployeePageQueryDTO; import com.sky.entity.Employee; import com.sky.enumeration.OperationType; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; @Mapper public interface EmployeeMapper { /** * 根据用户名查询员工 * @param username * @return */ @Select("select * from employee where username = #{username}") Employee getByUsername(String username); @Insert("insert into employee(name,username,password,phone,sex,id_number,create_time,update_time,create_user,update_user,status)"+ "values "+ "(#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{createTime},#{updateTime},#{createUser},#{updateUser},#{status})") @AutoFill(value = OperationType.INSERT) void insert(Employee employee); //分页查询 Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO); //根据主键动态修改属性,动态修改不用注解,用mapper映射文件写入 @AutoFill(value = OperationType.UPDATE) void update(Employee employee); //通过id查询员工 @Select("select * from employee where id = #{id}") Employee getById(Long id); }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/mapper/EmployeeMapper.java
Java
unknown
1,369
package com.sky.mapper; import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper public interface SetmealDishMapper { // 根据菜品id查询套餐id List<Long> getSetmealIdsByDishIds(List<Long> dishIds); }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/mapper/SetmealDishMapper.java
Java
unknown
243
package com.sky.mapper; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; @Mapper public interface SetmealMapper { /** * 根据分类id查询套餐的数量 * @param id * @return */ @Select("select count(id) from setmeal where category_id = #{categoryId}") Integer countByCategoryId(Long id); }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/mapper/SetmealMapper.java
Java
unknown
372
package com.sky.service; import com.sky.dto.CategoryDTO; import com.sky.dto.CategoryPageQueryDTO; import com.sky.entity.Category; import com.sky.result.PageResult; import java.util.List; public interface CategoryService { /** * 新增分类 * @param categoryDTO */ void save(CategoryDTO categoryDTO); /** * 分页查询 * @param categoryPageQueryDTO * @return */ PageResult pageQuery(CategoryPageQueryDTO categoryPageQueryDTO); /** * 根据id删除分类 * @param id */ void deleteById(Long id); /** * 修改分类 * @param categoryDTO */ void update(CategoryDTO categoryDTO); /** * 启用、禁用分类 * @param status * @param id */ void startOrStop(Integer status, Long id); /** * 根据类型查询分类 * @param type * @return */ List<Category> list(Integer type); }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/service/CategoryService.java
Java
unknown
935
package com.sky.service; import com.sky.dto.DishDTO; import com.sky.dto.DishPageQueryDTO; import com.sky.result.PageResult; import com.sky.vo.DishVO; import java.util.List; public interface DishService { //新增菜品及对应的口味数据 public void saveWithFlavor(DishDTO dishDTO); PageResult pageQuery(DishPageQueryDTO dishPageQueryDTO); void deleteBatch(List<Long> ids); /** * 根据id查询菜品和对应的口味 * @param id * @return */ DishVO getByIdWithFlavor(Long id); /** * 修改菜品 * @param dishDTO * @return */ void updateWithFlavor(DishDTO dishDTO); }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/service/DishService.java
Java
unknown
664
package com.sky.service; import com.sky.dto.EmployeeDTO; import com.sky.dto.EmployeeLoginDTO; import com.sky.dto.EmployeePageQueryDTO; import com.sky.entity.Employee; import com.sky.result.PageResult; public interface EmployeeService { /** * 员工登录 * @param employeeLoginDTO * @return */ Employee login(EmployeeLoginDTO employeeLoginDTO); /** * 新增员工 * @param employeeDTO */ void save(EmployeeDTO employeeDTO); //分页查询 PageResult pageQuery(EmployeePageQueryDTO employeePageQueryDTO); //启用禁用员工账号 void startOrStop(Integer status, Long id); //通过id查询员工 Employee getById(Long id); //编辑员工信息 void update(EmployeeDTO employeeDTO1); }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/service/EmployeeService.java
Java
unknown
787
package com.sky.service.impl; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.sky.constant.MessageConstant; import com.sky.constant.StatusConstant; import com.sky.context.BaseContext; import com.sky.dto.CategoryDTO; import com.sky.dto.CategoryPageQueryDTO; import com.sky.entity.Category; import com.sky.exception.DeletionNotAllowedException; import com.sky.mapper.CategoryMapper; import com.sky.mapper.DishMapper; import com.sky.mapper.SetmealMapper; import com.sky.result.PageResult; import com.sky.service.CategoryService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.util.List; /** * 分类业务层 */ @Service @Slf4j public class CategoryServiceImpl implements CategoryService { @Autowired private CategoryMapper categoryMapper; @Autowired private DishMapper dishMapper; @Autowired private SetmealMapper setmealMapper; /** * 新增分类 * @param categoryDTO */ public void save(CategoryDTO categoryDTO) { Category category = new Category(); //属性拷贝 BeanUtils.copyProperties(categoryDTO, category); //分类状态默认为禁用状态0 category.setStatus(StatusConstant.DISABLE); //设置创建时间、修改时间、创建人、修改人 category.setCreateTime(LocalDateTime.now()); category.setUpdateTime(LocalDateTime.now()); category.setCreateUser(BaseContext.getCurrentId()); category.setUpdateUser(BaseContext.getCurrentId()); categoryMapper.insert(category); } /** * 分页查询 * @param categoryPageQueryDTO * @return */ public PageResult pageQuery(CategoryPageQueryDTO categoryPageQueryDTO) { PageHelper.startPage(categoryPageQueryDTO.getPage(),categoryPageQueryDTO.getPageSize()); //下一条sql进行分页,自动加入limit关键字分页 Page<Category> page = categoryMapper.pageQuery(categoryPageQueryDTO); return new PageResult(page.getTotal(), page.getResult()); } /** * 根据id删除分类 * @param id */ public void deleteById(Long id) { //查询当前分类是否关联了菜品,如果关联了就抛出业务异常 Integer count = dishMapper.countByCategoryId(id); if(count > 0){ //当前分类下有菜品,不能删除 throw new DeletionNotAllowedException(MessageConstant.CATEGORY_BE_RELATED_BY_DISH); } //查询当前分类是否关联了套餐,如果关联了就抛出业务异常 count = setmealMapper.countByCategoryId(id); if(count > 0){ //当前分类下有菜品,不能删除 throw new DeletionNotAllowedException(MessageConstant.CATEGORY_BE_RELATED_BY_SETMEAL); } //删除分类数据 categoryMapper.deleteById(id); } /** * 修改分类 * @param categoryDTO */ public void update(CategoryDTO categoryDTO) { Category category = new Category(); BeanUtils.copyProperties(categoryDTO,category); //设置修改时间、修改人 category.setUpdateTime(LocalDateTime.now()); category.setUpdateUser(BaseContext.getCurrentId()); categoryMapper.update(category); } /** * 启用、禁用分类 * @param status * @param id */ public void startOrStop(Integer status, Long id) { Category category = Category.builder() .id(id) .status(status) .updateTime(LocalDateTime.now()) .updateUser(BaseContext.getCurrentId()) .build(); categoryMapper.update(category); } /** * 根据类型查询分类 * @param type * @return */ public List<Category> list(Integer type) { return categoryMapper.list(type); } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/service/impl/CategoryServiceImpl.java
Java
unknown
4,087
package com.sky.service.impl; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.sky.annotation.AutoFill; import com.sky.constant.MessageConstant; import com.sky.constant.StatusConstant; import com.sky.dto.DishDTO; import com.sky.dto.DishPageQueryDTO; import com.sky.entity.Dish; import com.sky.entity.DishFlavor; import com.sky.enumeration.OperationType; import com.sky.exception.DeletionNotAllowedException; import com.sky.mapper.DishFlavorMapper; import com.sky.mapper.DishMapper; import com.sky.mapper.SetmealDishMapper; import com.sky.result.PageResult; import com.sky.service.DishService; import com.sky.vo.DishVO; import lombok.extern.slf4j.Slf4j; import lombok.val; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service @Slf4j public class DishServiceimpl implements DishService { @Autowired private DishMapper dishMapper; @Autowired private DishFlavorMapper dishFlavorMapper; @Autowired private SetmealDishMapper setmealDishMapper; //新增菜品及对应的口味数据 @Override @Transactional public void saveWithFlavor(DishDTO dishDTO) { log.info("新增菜品:{}", dishDTO); Dish dish = new Dish(); BeanUtils.copyProperties(dishDTO, dish); dishMapper.insert(dish); Long dishId = dish.getId(); List<DishFlavor> flavors = dishDTO.getFlavors(); if (flavors!=null && flavors.size()>0 ){ flavors.forEach(dishFlavor -> dishFlavor.setDishId(dishId)); dishFlavorMapper.insertBatch(flavors); } } //分页查询 @Override public PageResult pageQuery(DishPageQueryDTO dishPageQueryDTO) { log.info("分页查询:{}", dishPageQueryDTO); PageHelper.startPage(dishPageQueryDTO.getPage(), dishPageQueryDTO.getPageSize()); Page<DishVO> page = dishMapper.pageQuery(dishPageQueryDTO); return new PageResult(page.getTotal(), page.getResult()); } //批量删除 @Override @Transactional public void deleteBatch(List<Long> ids) { log.info("批量删除:{}", ids); for (Long id : ids) { Dish dish = dishMapper.getById(id); if (dish.getStatus() == StatusConstant.ENABLE) { throw new DeletionNotAllowedException(MessageConstant.DISH_ON_SALE); } } List<Long> setmealIds = setmealDishMapper.getSetmealIdsByDishIds(ids); if (setmealIds != null && setmealIds.size() > 0) { throw new DeletionNotAllowedException(MessageConstant.DISH_BE_RELATED_BY_SETMEAL); } /* for (Long id : ids) { dishMapper.deleteById(id); dishFlavorMapper.deleteByDishId(id); }*/ //根据菜品id集合批量删除菜品数据 dishMapper.deleteByIds(ids); //根据菜品id集合批量删除口味数据 dishFlavorMapper.deleteByDishIds(ids); } /** * 根据id查询菜品和对应的口味 * @param id * @return */ @Override public DishVO getByIdWithFlavor(Long id) { Dish dish = dishMapper.getById(id); List<DishFlavor> dishFlavors = dishFlavorMapper.getByDishId(id); DishVO dishVO = new DishVO(); BeanUtils.copyProperties(dish, dishVO); dishVO.setFlavors(dishFlavors); return dishVO; } /** * 修改菜品 * @param dishDTO * @return */ @Override public void updateWithFlavor(DishDTO dishDTO) { log.info("编辑菜品:{}", dishDTO); Dish dish = new Dish(); BeanUtils.copyProperties(dishDTO, dish); dishMapper.update(dish); dishFlavorMapper.deleteByDishId(dishDTO.getId()); List<DishFlavor> flavors = dishDTO.getFlavors(); if (flavors!=null && flavors.size()>0 ){ flavors.forEach(dishFlavor -> dishFlavor.setDishId(dishDTO.getId())); dishFlavorMapper.insertBatch(flavors); } } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/service/impl/DishServiceimpl.java
Java
unknown
4,220
package com.sky.service.impl; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.sky.constant.MessageConstant; import com.sky.constant.PasswordConstant; import com.sky.constant.StatusConstant; import com.sky.context.BaseContext; import com.sky.dto.EmployeeDTO; import com.sky.dto.EmployeeLoginDTO; import com.sky.dto.EmployeePageQueryDTO; import com.sky.entity.Employee; import com.sky.exception.AccountLockedException; import com.sky.exception.AccountNotFoundException; import com.sky.exception.PasswordErrorException; import com.sky.mapper.EmployeeMapper; import com.sky.result.PageResult; import com.sky.service.EmployeeService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.DigestUtils; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.List; @Service public class EmployeeServiceImpl implements EmployeeService { @Autowired private EmployeeMapper employeeMapper; /** * 员工登录 * * @param employeeLoginDTO * @return */ public Employee login(EmployeeLoginDTO employeeLoginDTO) { String username = employeeLoginDTO.getUsername(); String password = employeeLoginDTO.getPassword(); //1、根据用户名查询数据库中的数据 Employee employee = employeeMapper.getByUsername(username); //2、处理各种异常情况(用户名不存在、密码不对、账号被锁定) if (employee == null) { //账号不存在 throw new AccountNotFoundException(MessageConstant.ACCOUNT_NOT_FOUND); } //密码比对 // TODO 后期需要进行md5加密,然后再进行比对 password = DigestUtils.md5DigestAsHex(password.getBytes()); if (!password.equals(employee.getPassword())) { //密码错误 throw new PasswordErrorException(MessageConstant.PASSWORD_ERROR); } if (employee.getStatus() == StatusConstant.DISABLE) { //账号被锁定 throw new AccountLockedException(MessageConstant.ACCOUNT_LOCKED); } //3、返回实体对象 return employee; } /** * 新增员工 * @param employeeDTO */ public void save(EmployeeDTO employeeDTO) { Employee employee = new Employee(); BeanUtils.copyProperties(employeeDTO, employee); employee.setStatus(StatusConstant.ENABLE); //设置默认密码 employee.setPassword(DigestUtils.md5DigestAsHex(PasswordConstant.DEFAULT_PASSWORD.getBytes())); //记录设置时间和修改时间 //employee.setCreateTime(LocalDateTime.now()); //employee.setUpdateTime(LocalDateTime.now()); //todo 后期要改为当前登录的id //employee.setCreateUser(BaseContext.getCurrentId()); //employee.setUpdateUser(BaseContext.getCurrentId()); employeeMapper.insert(employee); } //分页查询 @Override public PageResult pageQuery(EmployeePageQueryDTO employeePageQueryDTO) { PageHelper.startPage(employeePageQueryDTO.getPage(),employeePageQueryDTO.getPageSize()); Page<Employee> page = employeeMapper.pageQuery(employeePageQueryDTO); long total = page.getTotal(); List<Employee> records = page.getResult(); return new PageResult(total,records); } @Override public void startOrStop(Integer status, Long id) { Employee employee = Employee.builder() .id(id) .status(status) .build(); employeeMapper.update(employee); } //通过id查询员工 @Override public Employee getById(Long id) { Employee employee = employeeMapper.getById(id); employee.setPassword("******"); return employee; } //编辑员工信息 @Override public void update(EmployeeDTO employeeDTO) { Employee employee = new Employee(); BeanUtils.copyProperties(employeeDTO, employee); employee.setUpdateTime(LocalDateTime.now()); employee.setUpdateUser(BaseContext.getCurrentId()); employeeMapper.update(employee); } }
2301_80211016/cqwm
sky-server/src/main/java/com/sky/service/impl/EmployeeServiceImpl.java
Java
unknown
4,362
/* * Copyright (c) 2023 Huawei Device Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" import "elf" rule TestCaseRule_OpenHarmony_SA_2023_0101 { meta: date = "2023-02-13" openharmony_sa = "OpenHarmony-SA-2023-0101" cve = "CVE-2023-0035" file = "libsoftbus_client.z.so" strings: $fix = "write InterfaceToken failed!" condition: $fix and console.log("OpenHarmony-SA-2023-0101 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2023/01/OpenHarmony-SA-2023-0101/TestCaseRule-OpenHarmony-SA-2023-0101.yara
YARA
unknown
1,012
/* * Copyright (c) 2023 Huawei Device Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" import "elf" rule TestCaseRule_OpenHarmony_SA_2023_0102 { meta: date = "2023-02-17" openharmony_sa = "OpenHarmony-SA-2023-0102" cve = "CVE-2023-0036" file = "libinputmethod_service.z.so" strings: /* .text:00045E0E LDRB.W R3, [SP,#0x68+var_34] .text:00045E12 ADD R0, PC ; .text:00045E14 LDR R2, [SP,#0x68+var_30] */ $fix = {9D F8 34 30 78 44 0E 9A} condition: $fix and console.log("OpenHarmony-SA-2023-0102 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2023/01/OpenHarmony-SA-2023-0102/TestCaseRule-OpenHarmony-SA-2023-0102.yara
YARA
unknown
1,207
/* * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" import "elf" rule TestCaseRule_OpenHarmony_SA_2023_0201 { meta: date = "2023-02" openharmony_sa = "OpenHarmony-SA-2023-0201" cve = "CVE-2023-0083" severity = "low" file = "libace_engine_declarative_ark.z.so" //受影响于OpenHarmony-v3.1-Release到OpenHarmony-v3.1.5-Release strings: $fix = "The number of argument is less than 1, or the argument is not array." //更新后字符串 condition: (elf.machine == elf.EM_ARM) and $fix and console.log("OpenHarmony-SA-2023-0201 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2023/02/OpenHarmony-SA-2023-0201/TestCaseRule-OpenHarmony-SA-2023-0201.yara
YARA
unknown
1,197
/* * Copyright (c) 2024 Beijing University Of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule TestCaseRule_CVE_2022_4450 { meta: date = "2023-1-15" file = "/system/lib/libhukssdk.z.so" openharmony_sa = "" strings: $original_pattern = {08 46 DF 22 7C 44 21 46 82 F0 8A ED 01 98 21 46 DF 22 00 68 82 F0 84 ED} $new_pattern = { 08 46 31 46 DF 22 82 F0 92 E8 00 20 31 46 20 60 DF 22 02 9C 20 68 82 F0 8A E8 } condition: ((not $original_pattern) and $new_pattern) and console.log("CVE_2022_4450 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2023/03/CVE-2022-4450/TestCaseInfo-CVE-2022-4450.yara
YARA
unknown
1,137
/* * Copyright (c) 2024 BUPT. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" import "elf" rule TestCaseRule_CVE_2023_23914 { meta: date="2023-03" openharmony_sa="" cve="CVE-2023-23914" affected_files="libhttp.z.so" path ="rk3568/lib.unstripped/communication/netstack/libhttp.z.so" strings: $fix = "Reject response due to more than %u content encodings" condition: $fix and console.log("CVE-2023-23914 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2023/03/CVE-2023-23914/TestCaseRule-CVE-2023-23914.yara
YARA
unknown
989
/* * Copyright (c) 2023 Huawei Device Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" import "elf" rule TestCaseRule_OpenHarmony_SA_2023_0301 { meta: date = "2023-03-08" openharmony_sa = "OpenHarmony-SA-2023-0301" cve = "CVE-2023-24465" severity = "medium" file = "libwifi_scan_ability.z.so" func = "WifiScanStub::OnScanByParams" strings: $features = "run OnScanByParams code %{public}u, datasize %{public}zu" nocase wide ascii /* 3.1.4 vul code .text:0000B0D0 01 46 MOV R1, R0 .text:0000B0D2 20 46 MOV R0, R4 */ $vul = {01 46 ?? 46} /* 3.1.4 with patch .text:0000B0DA 7D 44 ADD R5, PC ; "" .text:0000B0DC 08 BF IT EQ .text:0000B0DE 29 46 MOVEQ R1, R5 */ $fix = {7? 44 08 BF ?? 46} condition: (elf.machine == elf.EM_ARM) and $features and ((not $vul) or $fix) and console.log("OpenHarmony-SA-2023-0301 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2023/03/OpenHarmony-SA-2023-0301/TestCaseRule-OpenHarmony-SA-2023-0301.yara
YARA
unknown
1,828
/* * Copyright (c) 2023 Huawei Device Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" import "elf" rule TestCaseRule_OpenHarmony_SA_2023_0302 { meta: date = "2023-03-10" openharmony_sa = "OpenHarmony-SA-2023-0302" file = "libappexecfwk_core.z.so" path = "rk3568/appexecfwk/bundle_framework/libappexecfwk_core.z.so" strings: $fix = "ERR_APPEXECFWK_PARSE_PROFILE_PROP_SIZE_CHECK_ERROR" condition: $fix and console.log("OpenHarmony-SA-2023-0302 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2023/03/OpenHarmony-SA-2023-0302/TestCaseRule-OpenHarmony-SA-2023-0302.yara
YARA
unknown
1,043
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule TestCaseRule_OpenHarmony_CVE_2022_30787 { meta: date = "2024-01-15" file = "/system/bin/fsck.ntfs" strings: $fix = "name in inode %lld" condition: $fix and console.log("TestCaseRule-OpenHarmony-CVE-2022-30787 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2023/04/OpenHarmony-CVE-2022-30787/TestCaseRule-OpenHarmony-CVE-2022-30787.yara
YARA
unknown
973
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule TestCaseRule_CVE_2024_2398 { meta: date="2024-11-11" openharmony_sa="" cve="CVE-2024-2398" affected_files="/system/lib/libcurl_shared.z.so" strings: $fix= {F0 B5 ?? B0 ?? 46 D0 F8 ?? ?? ?? 4D ?? 44 60 B1} condition: $fix and console.log("CVE-2024-2398 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/06/CVE-2024-2398/TestCaseRule-CVE-2024-2398.yara
YARA
unknown
1,004
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule TestCaseRule_CVE_2024_2478 { meta: date="2024-11-11" openharmony_sa="" cve="CVE-2024-2478" affected_files="/system/lib/libwpa_sys.z.so"//in 4.1.x, and "/system/lib/libwpa.z.so" in 4.0.x strings: $fixstring= "EAP-PEAP: Require Phase 2 authentication for initial connection" condition: $fixstring and console.log("CVE-2024-2478 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/06/CVE-2024-2478/TestCaseRule-CVE-2024-2478.yara
YARA
unknown
1,077
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule CVE_2024_26883 { meta: date="2024-12-05" openharmony_sa="" cve="CVE-2024-26883" affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix_4_0_x = {89 35 01 D0 29 85 4C B9 3F 0D 55 6B 03 FE FF 54 14 00 00 14} $fix_4_1_x = {1F 01 09 6B 69 00 00 54 D4 00 80 92 EA FF FF 17} condition: ($fix_4_0_x or $fix_4_1_x) and console.log("CVE-2024-26883 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/07/CVE-2024-26883/TestCaseRule-CVE-2024-26883.yara
YARA
unknown
1,124
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule CVE_2024_26884 { meta: date="2024-12-05" openharmony_sa="" cve="CVE-2024-26884" affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix = {1F 01 09 6B 48 03 00 54 E8 03 08 2A} condition: $fix and console.log("CVE-2024-26884 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/07/CVE-2024-26884/TestCaseRule-CVE-2024-26884.yara
YARA
unknown
1,006
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" import "elf" rule TestCaseRule_CVE_2024_27004 { meta: date = "2024-12-23" file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix = {08 20 80 D2 49 04 80 52 A8 D5 FB F2 ?? 16 01 ?? 00 80 ?? 91} condition: $fix and console.log("CVE-2024-27004 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/07/CVE-2024-27004/TestCaseRule-CVE-2024-27004.yara
YARA
unknown
1,021
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule CVE_2024_27038 { meta: date="2024-05-01" openharmony_sa="" cve="CVE_2024_27038" affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $vul = {1f 04 40 b1 48 00 00 54 00 00 40 f9} $fix = {1f 04 40 b1 68 00 00 54 48 00 00 54 00 00 40 f9} condition: ((not $vul) or $fix) and console.log("CVE_2024_27038 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/07/CVE-2024-27038/CVE-2024-27038.yara
YARA
unknown
1,081
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule CVE_2023_52739 { meta: date="2025-06-30" openharmony_sa="" cve="CVE_2023_52739" affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $vul = {6a 16 42 f9 4a 21 00 91 15 00 00 14} $fix = {68 1a 42 f9 17 05 00 f9 1b 00 00 14} condition: ((not $vul) or $fix) and console.log("CVE_2024_52739 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2023-52739/TestCaseRule-CVE-2023-52739.yara
YARA
unknown
1,069
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule CVE_2024_52781 { meta: date="2024-05-21" openharmony_sa="" cve="CVE_2023_52781" affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $vul = {6a 16 42 f9 4a 21 00 91 15 00 00 14} $fix = {68 1a 42 f9 17 05 00 f9 1b 00 00 14} condition: ((not $vul) or $fix) and console.log("CVE_2024_27038 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2023-52781/CVE-2023-52781.yara
YARA
unknown
1,069
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule TestCaseRule_CVE_2024_52835 { meta: data="2024-12-17" openharmony_sa="" cve="CVE-2024-52835" file="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $b_version = {C8 7E 7D 93 08 05 00 D1 1F 05 40 F1} $b_version2 = {08 FD 4C D3 08 11 C0 DA 1F D5 00 71} condition: $b_version and $b_version2 and console.log("CVE-2023-52835 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2023-52835/TestCaseRule-CVE-2023-52835.yara
YARA
unknown
1,075
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule TestCaseRule_CVE_2023_52868 { meta: date = "2024-12-27" file = "" strings: $fix = {FA 03 16 AA ?2 6F 00 ?0 42 ?? ?? 91 81 02 80 52 43 87 44 B8 E0 03 1A AA ?? B? E4 97} condition: $fix and console.log("TestCaseRule_CVE_2023_52868 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2023-52868/TestCaseRule-CVE-2023-52868.yara
YARA
unknown
1,007
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule CVE_2024_26733 { meta: date="2024-12-23" openharmony_sa="" cve="CVE-2024-26733" affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix = {61 62 03 91 1F 39 00 71 02 31 89 1A} condition: $fix and console.log("CVE-2024-26733 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2024-26733/TestCaseRule-CVE-2024-26733.yara
YARA
unknown
1,006
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule CVE_2024_26934 { meta: date="2024-12-05" openharmony_sa="" cve="CVE-2024-26934" affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix = {?? E0 FF 97 E0 03 14 AA ?? ?? DB 97} condition: $fix and console.log("CVE-2024-26934 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2024-26934/TestCaseRule-CVE-2024-26934.yara
YARA
unknown
1,006
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule TestCaseRule_CVE_2024_27399 { meta: date = "2024-05-23" file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux" openharmony_sa="" cve="CVE_2024_27399" strings: $vul = {75 02 40 F9 ?? 05 10 37 } $fix = {75 02 40 F9 ?? 05 10 37 D5 04 00 B4} condition: ((not $vul) or $fix) and console.log("CVE_2024_27399 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2024-27399/TestCaseRule-CVE-2024-27399.yara
YARA
unknown
1,098
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule TestCaseRule_CVE_2024_28182 { meta: date="2024-11-15" openharmony_sa="" cve="CVE-2024-28182" affected_files="/system/lib/platformsdk/libnghttp2_shared.z.so" strings: $fixstring = "Too many CONTINUATION frames following a HEADER frame" condition: $fixstring and console.log("CVE-2024-28182 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2024-28182/TestCaseRule-CVE-2024-28182.yara
YARA
unknown
1,069
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule CVE_2024_35789 { meta: date = "20240508" file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix = {0? 1D 00 94} $unfix = {A4 1D 00 94} /* 4.1.3 版本特殊判断 */ $s = {B4 34 00 94} condition: $fix and ( not $unfix or $s ) and console.log("CVE-2024-35789 pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2024-35789/CVE-2024-35789.yara
YARA
unknown
1,055
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule TestcaseRule_OpenHarmony_CVE_2024_35822 { meta: date = "2024-05-17" file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix = "USB gadget: queue request to disabled ep 0x%x (%s)\n" condition: $fix and console.log("OpenHarmony-CVE-2024-35822 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2024-35822/TestcaseRule-OpenHarmony-CVE-2024-35822.yara
YARA
unknown
1,027
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule TestCaseRule_OpenHarmony_CVE_2024_35969 { meta: date="2024-06-20" files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix = {C0 82 00 91 08 FC DF 88 08 02 00 34} condition: $fix and console.log("CVE-2024-35969 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2024-35969/TestCaseRule-OpenHarmony-CVE-2024-35969.yara
YARA
unknown
975
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" import "elf" rule CVE_2024_36008 { meta: date="2024-12-18" openharmony_sa="" cve="CVE-2024-36008" affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix= {C6 06 00 B4 F3 03 00 AA A0 02 80 12 4B 0C 1C 12 7F 81 03 71} condition: $fix and console.log("CVE-2024-36008 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2024-36008/TestCaseRule-CVE-2024-36008.yara
YARA
unknown
1,041
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule CVE_2024_36899 { meta: date="2024-12-06" openharmony_sa="" cve="CVE-2024-36939" affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix = {?? ?? E3 97 60 32 52 F9} condition: $fix and console.log("CVE-2024-36899 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2024-36899/TestCaseRule-CVE-2024-36899.yara
YARA
unknown
993
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule CVE_2024_36901 { meta: date="2024-12-16" openharmony_sa="" cve="CVE-2024-36901" affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix = {CB B0 9B 52 A8 83 1F F8 48 2C 40 F9 08 F9 7F 92 09 01 40 F9 0A 5D 40 F9 4B 58 01 79 48 08 40 F9 49 08 00 F9 EA 05 00 B4 4B A9 41 B9 8B 04 00 35 F5 03 01 AA 6A 72 40 79 4A 02 10 37} condition: $fix and console.log("CVE-2024-36901 testcase pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2024-36901/TestCaseRule-CVE-2024-36901.yara
YARA
unknown
1,149
/* * Copyright (c) 2024 Beijing University of Posts and Telecommunications. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import "console" rule CVE_2024_36904 { meta: date = "20240508" file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux" strings: $fix = {B5 FD FF 35} condition: $fix and console.log("CVE-2024-36904 pass") }
2301_80000730/security_2000
vulntest/SSTSTestcases/2024/08/CVE-2024-36904/CVE-2024-36904.yara
YARA
unknown
940