diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/ArtistScheduleServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/ArtistScheduleServiceImplTest.java deleted file mode 100644 index ba77f078..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/ArtistScheduleServiceImplTest.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.artist.service.impl; - -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.ArtistScheduleExceptionDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.ArtistScheduleDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.ArtistScheduleRuleDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.entity.ArtistScheduleDO; -import com.xiaowang.fingertipdesigner.core.modules.artist.entity.ArtistScheduleExceptionDO; -import com.xiaowang.fingertipdesigner.core.modules.artist.entity.ArtistScheduleRuleDO; -import com.xiaowang.fingertipdesigner.core.modules.artist.mapper.ArtistScheduleExceptionMapper; -import com.xiaowang.fingertipdesigner.core.modules.artist.mapper.ArtistScheduleMapper; -import com.xiaowang.fingertipdesigner.core.modules.artist.mapper.ArtistScheduleRuleMapper; -import com.xiaowang.fingertipdesigner.core.modules.planning.mapper.AppointmentReservationMapper; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - -import java.time.DayOfWeek; -import java.time.LocalDate; -import java.time.LocalTime; -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class ArtistScheduleServiceImplTest { - - @Mock - private ArtistScheduleMapper scheduleMapper; - @Mock - private ArtistScheduleRuleMapper ruleMapper; - @Mock - private ArtistScheduleExceptionMapper exceptionMapper; - @Mock - private AppointmentReservationMapper reservationMapper; - - private ArtistScheduleServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new ArtistScheduleServiceImpl(scheduleMapper, ruleMapper, exceptionMapper, reservationMapper); - when(ruleMapper.selectOne(any())).thenReturn(null); - when(exceptionMapper.selectList(any())).thenReturn(List.of()); - when(scheduleMapper.selectDayScheduleForUpdate(eq(8L), eq(30L), any(LocalDate.class))).thenAnswer(invocation -> existingSchedule(invocation.getArgument(2))); - when(reservationMapper.countActiveByArtistAndDateForUpdate(eq(8L), eq(30L), any(LocalDate.class))).thenReturn(0); - when(reservationMapper.countActiveOutsideScheduleForUpdate(eq(8L), eq(30L), any(LocalDate.class), any(LocalTime.class), any(LocalTime.class))).thenReturn(0); - } - - @Test - void saveDoubleRestRuleGeneratesWeekdaySchedulesAndWeekendRestRows() { - service.saveRule(rule("DOUBLE_REST", List.of(1, 2, 3, 4, 5), LocalTime.of(9, 0), LocalTime.of(17, 0))); - - ArgumentCaptor statusCaptor = ArgumentCaptor.forClass(Integer.class); - verify(scheduleMapper, org.mockito.Mockito.atLeastOnce()).updateGeneratedSchedule(any(), any(), any(), any(), any(), statusCaptor.capture(), any()); - assertThat(statusCaptor.getAllValues()).contains(1, 0); - } - - @Test - void saveCustomRuleUsesSelectedWeekdaysOnly() { - service.saveRule(rule("CUSTOM", List.of(2, 4), LocalTime.of(10, 0), LocalTime.of(20, 0))); - - ArgumentCaptor dateCaptor = ArgumentCaptor.forClass(LocalDate.class); - ArgumentCaptor statusCaptor = ArgumentCaptor.forClass(Integer.class); - verify(scheduleMapper, org.mockito.Mockito.atLeastOnce()).selectDayScheduleForUpdate(eq(8L), eq(30L), dateCaptor.capture()); - verify(scheduleMapper, org.mockito.Mockito.atLeastOnce()).updateGeneratedSchedule(any(), any(), any(), any(), any(), statusCaptor.capture(), any()); - - List dates = dateCaptor.getAllValues(); - List statuses = statusCaptor.getAllValues(); - for (int index = 0; index < statuses.size(); index++) { - DayOfWeek dayOfWeek = dates.get(index).getDayOfWeek(); - if (List.of(DayOfWeek.TUESDAY, DayOfWeek.THURSDAY).contains(dayOfWeek)) { - assertThat(statuses.get(index)).isEqualTo(1); - } else { - assertThat(statuses.get(index)).isEqualTo(0); - } - } - } - - @Test - void saveRestExceptionRejectsDateWithActiveReservation() { - LocalDate date = LocalDate.now().plusDays(1L); - when(ruleMapper.selectOne(any())).thenReturn(existingRule()); - when(exceptionMapper.selectOne(any())).thenReturn(null); - when(reservationMapper.countActiveByArtistAndDateForUpdate(8L, 30L, date)).thenReturn(2); - - assertThatThrownBy(() -> service.saveException(restException(date))) - .isInstanceOf(RuntimeException.class) - .hasMessageContaining(date.toString()) - .hasMessageContaining("2"); - - verify(exceptionMapper).insert(any(ArtistScheduleExceptionDO.class)); - verify(scheduleMapper, never()).updateGeneratedSchedule(any(), any(), any(), any(), any(), any(), any()); - } - - @Test - void saveExtraWorkExceptionGeneratesWorkingScheduleOnRestDay() { - LocalDate sunday = next(DayOfWeek.SUNDAY); - when(ruleMapper.selectOne(any())).thenReturn(existingRule()); - when(exceptionMapper.selectOne(any())).thenReturn(null); - - service.saveException(extraWorkException(sunday)); - - verify(scheduleMapper).updateGeneratedSchedule(any(), eq(LocalTime.of(10, 0)), eq(LocalTime.of(18, 0)), eq(60), eq(1), eq(1), any()); - } - - @Test - void saveRuleUsesInternalCapacityAndSlotDefaults() { - service.saveRule(rule("DOUBLE_REST", List.of(1, 2, 3, 4, 5), LocalTime.of(9, 0), LocalTime.of(17, 0))); - - ArgumentCaptor slotCaptor = ArgumentCaptor.forClass(Integer.class); - ArgumentCaptor capacityCaptor = ArgumentCaptor.forClass(Integer.class); - verify(scheduleMapper, org.mockito.Mockito.atLeastOnce()).updateGeneratedSchedule(any(), any(), any(), slotCaptor.capture(), capacityCaptor.capture(), any(), any()); - assertThat(slotCaptor.getAllValues()).allMatch(value -> value == 60); - assertThat(capacityCaptor.getAllValues()).allMatch(value -> value == 1); - } - - @Test - void saveScheduleUpdatesExistingSlotInsteadOfDuplicatingGeneratedRow() { - LocalDate date = LocalDate.now().plusDays(1L); - ArtistScheduleDTO dto = new ArtistScheduleDTO(); - dto.setShopId(8L); - dto.setArtistId(30L); - dto.setWorkDate(date); - dto.setStartTime(LocalTime.of(9, 0)); - dto.setEndTime(LocalTime.of(19, 0)); - dto.setSlotMinutes(30); - dto.setCapacity(3); - dto.setStatus(1); - when(scheduleMapper.selectSlotScheduleForUpdate(8L, 30L, date, LocalTime.of(9, 0))).thenReturn(existingSchedule(date)); - - service.saveSchedule(dto); - - verify(scheduleMapper, never()).insert(any(ArtistScheduleDO.class)); - verify(scheduleMapper).updateGeneratedSchedule(any(), eq(LocalTime.of(9, 0)), eq(LocalTime.of(19, 0)), eq(30), eq(3), eq(1), any()); - } - - private ArtistScheduleRuleDTO rule(String presetType, List workDays, LocalTime startTime, LocalTime endTime) { - ArtistScheduleRuleDTO dto = new ArtistScheduleRuleDTO(); - dto.setShopId(8L); - dto.setArtistId(30L); - dto.setPresetType(presetType); - dto.setWorkDays(workDays); - dto.setStartTime(startTime); - dto.setEndTime(endTime); - return dto; - } - - private ArtistScheduleExceptionDTO restException(LocalDate date) { - ArtistScheduleExceptionDTO dto = new ArtistScheduleExceptionDTO(); - dto.setShopId(8L); - dto.setArtistId(30L); - dto.setWorkDate(date); - dto.setExceptionType("REST"); - return dto; - } - - private ArtistScheduleExceptionDTO extraWorkException(LocalDate date) { - ArtistScheduleExceptionDTO dto = new ArtistScheduleExceptionDTO(); - dto.setShopId(8L); - dto.setArtistId(30L); - dto.setWorkDate(date); - dto.setExceptionType("EXTRA_WORK"); - dto.setStartTime(LocalTime.of(10, 0)); - dto.setEndTime(LocalTime.of(18, 0)); - return dto; - } - - private ArtistScheduleRuleDO existingRule() { - ArtistScheduleRuleDO rule = new ArtistScheduleRuleDO(); - rule.setId(1L); - rule.setShopId(8L); - rule.setArtistId(30L); - rule.setPresetType("DOUBLE_REST"); - rule.setWorkDays("1,2,3,4,5"); - rule.setStartTime(LocalTime.of(9, 0)); - rule.setEndTime(LocalTime.of(17, 0)); - rule.setSlotMinutes(60); - rule.setCapacity(1); - rule.setStatus(1); - rule.setIsDelete(0); - return rule; - } - - private ArtistScheduleDO existingSchedule(LocalDate date) { - ArtistScheduleDO schedule = new ArtistScheduleDO(); - schedule.setId(1000L + date.getDayOfYear()); - schedule.setShopId(8L); - schedule.setArtistId(30L); - schedule.setWorkDate(date); - schedule.setStartTime(LocalTime.of(9, 0)); - schedule.setEndTime(LocalTime.of(17, 0)); - schedule.setSlotMinutes(60); - schedule.setCapacity(1); - schedule.setStatus(1); - schedule.setIsDelete(0); - return schedule; - } - - private LocalDate next(DayOfWeek dayOfWeek) { - LocalDate cursor = LocalDate.now(); - while (cursor.getDayOfWeek() != dayOfWeek) { - cursor = cursor.plusDays(1L); - } - return cursor; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/NailArtistInfoServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/NailArtistInfoServiceImplTest.java deleted file mode 100644 index 1b53de13..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/NailArtistInfoServiceImplTest.java +++ /dev/null @@ -1,292 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.artist.service.impl; - -import com.xiaowang.fingertipdesigner.core.modules.artist.entity.NailArtistInfoDO; -import com.xiaowang.fingertipdesigner.core.modules.artist.entity.ArtistScheduleDO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderArtistReviewDO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderDO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderItemDO; -import com.xiaowang.fingertipdesigner.core.modules.product.entity.ProductDO; -import com.xiaowang.fingertipdesigner.core.modules.shop.entity.ShopDO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.artist.mapper.NailArtistInfoMapper; -import com.xiaowang.fingertipdesigner.core.modules.planning.mapper.AppointmentReservationMapper; -import com.xiaowang.fingertipdesigner.core.modules.artist.mapper.ArtistScheduleMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderArtistReviewMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderItemMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderMapper; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.ProductMapper; -import com.xiaowang.fingertipdesigner.core.modules.shop.mapper.ShopMapper; -import com.xiaowang.fingertipdesigner.core.modules.user.mapper.UserMapper; -import com.xiaowang.fingertipdesigner.core.modules.file.service.ObjectStorageFileService; -import com.xiaowang.fingertipdesigner.core.modules.file.support.ObjectStorageUrlSupport; -import com.xiaowang.fingertipdesigner.core.modules.shop.support.UserShopBindingSupport; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.NailArtistAvailabilityVO; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.NailArtistProfileVO; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.NailArtistReviewVO; -import com.xiaowang.fingertipdesigner.core.modules.file.vo.ObjectStorageFileVO; -import com.xiaowang.fingertipdesigner.core.modules.shop.vo.ShopSimpleVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.test.util.ReflectionTestUtils; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.time.LocalDate; -import java.time.LocalTime; -import java.util.List; -import java.util.Map; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyBoolean; -import static org.mockito.Mockito.when; - -class NailArtistInfoServiceImplTest { - - @Mock - private NailArtistInfoMapper nailArtistInfoMapper; - @Mock - private UserMapper userMapper; - @Mock - private ShopMapper shopMapper; - @Mock - private UserShopBindingSupport userShopBindingSupport; - @Mock - private ProductMapper productMapper; - @Mock - private OrderMapper orderMapper; - @Mock - private OrderItemMapper orderItemMapper; - @Mock - private OrderArtistReviewMapper orderArtistReviewMapper; - @Mock - private ObjectStorageFileService objectStorageFileService; - @Mock - private ObjectStorageUrlSupport objectStorageUrlSupport; - @Mock - private ArtistScheduleMapper artistScheduleMapper; - @Mock - private AppointmentReservationMapper appointmentReservationMapper; - - private NailArtistInfoServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new NailArtistInfoServiceImpl(); - ReflectionTestUtils.setField(service, "baseMapper", nailArtistInfoMapper); - ReflectionTestUtils.setField(service, "userMapper", userMapper); - ReflectionTestUtils.setField(service, "shopMapper", shopMapper); - ReflectionTestUtils.setField(service, "userShopBindingSupport", userShopBindingSupport); - ReflectionTestUtils.setField(service, "productMapper", productMapper); - ReflectionTestUtils.setField(service, "orderMapper", orderMapper); - ReflectionTestUtils.setField(service, "orderItemMapper", orderItemMapper); - ReflectionTestUtils.setField(service, "orderArtistReviewMapper", orderArtistReviewMapper); - ReflectionTestUtils.setField(service, "objectStorageFileService", objectStorageFileService); - ReflectionTestUtils.setField(service, "objectStorageUrlSupport", objectStorageUrlSupport); - ReflectionTestUtils.setField(service, "artistScheduleMapper", artistScheduleMapper); - ReflectionTestUtils.setField(service, "appointmentReservationMapper", appointmentReservationMapper); - when(userShopBindingSupport.listShopOptionsByUserId(any(), anyBoolean(), anyBoolean())).thenReturn(List.of()); - when(objectStorageUrlSupport.toAccessibleUrl(any(ObjectStorageFileVO.class))) - .thenAnswer(invocation -> invocation.getArgument(0, ObjectStorageFileVO.class).getFileUrl()); - } - - @Test - void getPublicProfileAggregatesArtistBasicsWorksReviewsAndAvailability() { - NailArtistInfoDO artistInfo = new NailArtistInfoDO(); - artistInfo.setId(11L); - artistInfo.setUserId(7L); - artistInfo.setIdentity("Yumi senior artist"); - artistInfo.setExperience(5); - artistInfo.setSkills("法式,猫眼"); - artistInfo.setRating(new BigDecimal("4.7")); - artistInfo.setStatus(1); - artistInfo.setPortfolio("31"); - artistInfo.setWorkStartTime(LocalTime.of(10, 0)); - artistInfo.setWorkEndTime(LocalTime.of(12, 0)); - artistInfo.setIsDelete(0); - when(nailArtistInfoMapper.selectOne(any())).thenReturn(artistInfo); - - UserDO artist = new UserDO(); - artist.setId(7L); - artist.setNickname("Mina"); - artist.setAvatar("https://img.test/mina.jpg"); - artist.setSignature("Clean lines and soft colors"); - artist.setType(3); - artist.setShopId(9L); - artist.setIsDelete(0); - when(userMapper.selectById(7L)).thenReturn(artist); - - ShopDO shop = new ShopDO(); - shop.setId(9L); - shop.setShopName("Yumi Test Shop"); - when(shopMapper.selectById(9L)).thenReturn(shop); - when(userShopBindingSupport.listShopOptionsByUserId(7L, true, true)).thenReturn(List.of()); - - ProductDO product = new ProductDO(); - product.setId(31L); - product.setShopId(9L); - product.setTitle("Soft French"); - product.setPrice(new BigDecimal("168.00")); - product.setImageFileIds("201"); - product.setTags("通勤;显白"); - product.setIsDelete(0); - when(productMapper.selectBatchIds(any())).thenReturn(List.of(product)); - - ObjectStorageFileVO productImage = new ObjectStorageFileVO(); - productImage.setId(201L); - productImage.setFileUrl("https://img.test/product.jpg"); - when(objectStorageFileService.getObjectStorageFileMapByIds(any())).thenReturn(Map.of(201L, productImage)); - - OrderDO completedOrder = new OrderDO(); - completedOrder.setId(41L); - completedOrder.setStatus(2); - completedOrder.setIsDelete(0); - when(orderMapper.selectByArtistId(7L)).thenReturn(List.of(completedOrder)); - - OrderItemDO servedItem = new OrderItemDO(); - servedItem.setId(51L); - servedItem.setOrderId(41L); - servedItem.setArtistId(7L); - servedItem.setProductId(31L); - servedItem.setQuantity(2); - servedItem.setIsDelete(0); - when(orderItemMapper.selectByOrderId(41L)).thenReturn(List.of(servedItem)); - when(orderItemMapper.selectArtistCalendarItems(any(), any(), any())).thenReturn(List.of()); - - OrderArtistReviewDO submitted = new OrderArtistReviewDO(); - submitted.setId(61L); - submitted.setArtistId(7L); - submitted.setCustomerId(71L); - submitted.setProductId(31L); - submitted.setRatingScore(new BigDecimal("5.0")); - submitted.setContent("Lines are precise"); - submitted.setStatus(1); - submitted.setSubmittedAt(LocalDateTime.now().minusDays(1)); - submitted.setIsDelete(0); - when(orderArtistReviewMapper.selectList(any())).thenReturn(List.of(submitted)); - when(orderArtistReviewMapper.selectAverageSubmittedRatingByArtistId(7L)).thenReturn(new BigDecimal("5.0")); - - UserDO customer = new UserDO(); - customer.setId(71L); - customer.setNickname("Ava"); - when(userMapper.selectBatchIds(List.of(71L))).thenReturn(List.of(customer)); - - NailArtistProfileVO profile = service.getPublicProfile(7L); - - assertThat(profile.getArtistId()).isEqualTo(7L); - assertThat(profile.getArtistName()).isEqualTo("Mina"); - assertThat(profile.getShopName()).isEqualTo("Yumi Test Shop"); - assertThat(profile.getStyleTags()).containsExactly("法式", "猫眼"); - assertThat(profile.getRating()).isEqualByComparingTo("5.0"); - assertThat(profile.getServiceCount()).isEqualTo(2L); - assertThat(profile.getWorks()).hasSize(1); - assertThat(profile.getWorks().get(0).getCoverImageUrl()).isEqualTo("https://img.test/product.jpg"); - assertThat(profile.getReviews()).hasSize(1); - assertThat(profile.getReviews().get(0).getCustomerName()).isEqualTo("Ava"); - assertThat(profile.getAvailability()).isNotEmpty(); - } - - @Test - void listPublicReviewsReturnsSubmittedReviewsOnly() { - OrderArtistReviewDO submitted = new OrderArtistReviewDO(); - submitted.setId(61L); - submitted.setArtistId(7L); - submitted.setCustomerId(71L); - submitted.setRatingScore(new BigDecimal("4.5")); - submitted.setContent("Gentle and detailed"); - submitted.setStatus(1); - submitted.setSubmittedAt(LocalDateTime.now().minusHours(2)); - submitted.setIsDelete(0); - when(orderArtistReviewMapper.selectList(any())).thenReturn(List.of(submitted)); - - UserDO customer = new UserDO(); - customer.setId(71L); - customer.setNickname("Ava"); - when(userMapper.selectBatchIds(List.of(71L))).thenReturn(List.of(customer)); - - List reviews = service.listPublicReviews(7L); - - assertThat(reviews).hasSize(1); - assertThat(reviews.get(0).getRating()).isEqualByComparingTo("4.5"); - assertThat(reviews.get(0).getContent()).isEqualTo("Gentle and detailed"); - } - - @Test - void getAvailabilitySkipsBookedSlots() { - NailArtistInfoDO artistInfo = new NailArtistInfoDO(); - artistInfo.setUserId(7L); - artistInfo.setStatus(1); - artistInfo.setWorkStartTime(LocalTime.of(10, 0)); - artistInfo.setWorkEndTime(LocalTime.of(12, 0)); - artistInfo.setIsDelete(0); - when(nailArtistInfoMapper.selectOne(any())).thenReturn(artistInfo); - UserDO artist = new UserDO(); - artist.setId(7L); - artist.setType(3); - artist.setIsDelete(0); - when(userMapper.selectById(7L)).thenReturn(artist); - - OrderItemDO booked = new OrderItemDO(); - booked.setArtistId(7L); - booked.setAppointmentTime(LocalDateTime.now().plusDays(1).withHour(10).withMinute(0).withSecond(0).withNano(0)); - when(orderItemMapper.selectArtistCalendarItems(any(), any(), any())).thenReturn(List.of(booked)); - - List slots = service.getAvailability(7L); - - assertThat(slots).isNotEmpty(); - assertThat(slots) - .noneMatch(slot -> slot.getStartTime().toLocalDate().equals(booked.getAppointmentTime().toLocalDate()) - && slot.getStartTime().toLocalTime().equals(LocalTime.of(10, 0))); - } - - @Test - void getAvailabilityUsesScheduleCapacityWhenConfigured() { - NailArtistInfoDO artistInfo = new NailArtistInfoDO(); - artistInfo.setUserId(7L); - artistInfo.setStatus(1); - artistInfo.setWorkStartTime(LocalTime.of(10, 0)); - artistInfo.setWorkEndTime(LocalTime.of(12, 0)); - artistInfo.setIsDelete(0); - when(nailArtistInfoMapper.selectOne(any())).thenReturn(artistInfo); - UserDO artist = new UserDO(); - artist.setId(7L); - artist.setType(3); - artist.setShopId(9L); - artist.setIsDelete(0); - when(userMapper.selectById(7L)).thenReturn(artist); - - ShopDO shop = new ShopDO(); - shop.setId(9L); - shop.setShopName("Yumi Test Shop"); - ShopSimpleVO shopOption = new ShopSimpleVO(); - shopOption.setId(9L); - shopOption.setShopName("Yumi Test Shop"); - when(shopMapper.selectById(9L)).thenReturn(shop); - when(userShopBindingSupport.listShopOptionsByUserId(7L, true, true)).thenReturn(List.of(shopOption)); - - LocalDate workDate = LocalDate.now().plusDays(1); - ArtistScheduleDO schedule = new ArtistScheduleDO(); - schedule.setShopId(9L); - schedule.setArtistId(7L); - schedule.setWorkDate(workDate); - schedule.setStartTime(LocalTime.of(10, 0)); - schedule.setEndTime(LocalTime.of(12, 0)); - schedule.setSlotMinutes(60); - schedule.setCapacity(1); - schedule.setStatus(1); - schedule.setIsDelete(0); - when(artistScheduleMapper.selectList(any())).thenReturn(List.of(schedule)); - when(appointmentReservationMapper.countOverlappingActive(any(), any(), any())) - .thenReturn(1) - .thenReturn(0); - - List slots = service.getAvailability(7L); - - assertThat(slots).hasSize(1); - assertThat(slots.get(0).getStartTime().toLocalDate()).isEqualTo(workDate); - assertThat(slots.get(0).getStartTime().toLocalTime()).isEqualTo(LocalTime.of(11, 0)); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/FileOssBackupConfigurationTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/FileOssBackupConfigurationTest.java deleted file mode 100644 index ae40385e..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/FileOssBackupConfigurationTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.file; - -import com.xiaowang.fingertipdesigner.core.modules.file.config.AliyunOssConfig; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -class FileObjectStorageConfigurationTest { - - @Test - void aliyunOssConfigDoesNotHardCodeEnvironmentValues() { - AliyunOssConfig config = new AliyunOssConfig(); - - assertThat(config.getBucketName()).isNull(); - assertThat(config.getSignedUrlExpireMinutes()).isNull(); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/controller/front/FrontendFileControllerTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/controller/front/FrontendFileControllerTest.java deleted file mode 100644 index 42d08c6e..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/controller/front/FrontendFileControllerTest.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.file.controller.front; - -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.file.service.ObjectStorageFileService; -import com.xiaowang.fingertipdesigner.core.modules.file.support.ObjectStorageUrlSupport; -import com.xiaowang.fingertipdesigner.core.modules.file.vo.ObjectStorageFileVO; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.EffectDiagramMapper; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.ProductMapper; -import com.xiaowang.fingertipdesigner.core.modules.shop.mapper.ShopMapper; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class FrontendFileControllerTest { - - private ObjectStorageFileService objectStorageFileService; - private ObjectStorageUrlSupport objectStorageUrlSupport; - private ProductMapper productMapper; - private ShopMapper shopMapper; - private EffectDiagramMapper effectDiagramMapper; - private FrontendFileController controller; - - @BeforeEach - void setUp() { - objectStorageFileService = mock(ObjectStorageFileService.class); - objectStorageUrlSupport = mock(ObjectStorageUrlSupport.class); - productMapper = mock(ProductMapper.class); - shopMapper = mock(ShopMapper.class); - effectDiagramMapper = mock(EffectDiagramMapper.class); - controller = new FrontendFileController( - objectStorageFileService, - objectStorageUrlSupport, - productMapper, - shopMapper, - effectDiagramMapper - ); - } - - @Test - void getSignedUrlRejectsAvailableFileWhenItIsNotPubliclyReferenced() throws Exception { - ObjectStorageFileVO file = file(); - when(objectStorageFileService.getObjectStorageFileById(12L)).thenReturn(file); - when(productMapper.countPublicImageReference(12L)).thenReturn(0L); - when(shopMapper.countPublicImageReference(12L)).thenReturn(0L); - when(effectDiagramMapper.countPublicImageReference(12L)).thenReturn(0L); - - Result result = controller.getSignedUrl(12L, 60); - - assertThat(result.getCode()).isNotEqualTo(200); - verify(objectStorageUrlSupport, never()).toAccessibleUrl(any(ObjectStorageFileVO.class), anyInt()); - verify(objectStorageUrlSupport, never()).getSignedUrlOrThrow(any(ObjectStorageFileVO.class), anyInt()); - } - - @Test - void getSignedUrlAllowsPublicProductImageReference() throws Exception { - ObjectStorageFileVO file = file(); - file.setObjectName("public/a.png"); - when(objectStorageFileService.getObjectStorageFileById(12L)).thenReturn(file); - when(productMapper.countPublicImageReference(12L)).thenReturn(1L); - when(objectStorageUrlSupport.getSignedUrlOrThrow(file, 30)).thenReturn("https://signed.test/public/a.png"); - - Result result = controller.getSignedUrl(12L, 30); - - assertThat(result.getCode()).isEqualTo(200); - assertThat(result.getData()).isEqualTo("https://signed.test/public/a.png"); - } - - @Test - void getSignedUrlFallsBackToOriginalPublicExternalUrlWhenObjectNameCannotBeExtracted() throws Exception { - ObjectStorageFileVO file = file(); - file.setFileUrl("https://acceptance.local/images/public-a.png"); - when(objectStorageFileService.getObjectStorageFileById(12L)).thenReturn(file); - when(productMapper.countPublicImageReference(12L)).thenReturn(1L); - - Result result = controller.getSignedUrl(12L, 30); - - assertThat(result.getCode()).isEqualTo(200); - assertThat(result.getData()).isEqualTo("https://acceptance.local/images/public-a.png"); - verify(objectStorageUrlSupport, never()).getSignedUrlOrThrow(any(ObjectStorageFileVO.class), anyInt()); - } - - private ObjectStorageFileVO file() { - ObjectStorageFileVO file = new ObjectStorageFileVO(); - file.setId(12L); - file.setStatus(1); - file.setFileUrl("https://cdn.test/public/a.png"); - return file; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/scheduler/ObjectStorageBackupRetrySchedulerTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/scheduler/ObjectStorageBackupRetrySchedulerTest.java deleted file mode 100644 index 8c2adee8..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/scheduler/ObjectStorageBackupRetrySchedulerTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.file.scheduler; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.xiaowang.fingertipdesigner.core.config.ObjectStorageProperties; -import com.xiaowang.fingertipdesigner.core.modules.file.entity.ObjectStorageReplicaDO; -import com.xiaowang.fingertipdesigner.core.modules.file.mapper.ObjectStorageReplicaMapper; -import com.xiaowang.fingertipdesigner.core.modules.file.service.ObjectStorageBackupService; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; - -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class ObjectStorageBackupRetrySchedulerTest { - - private ObjectStorageReplicaMapper objectStorageReplicaMapper; - private ObjectStorageBackupService objectStorageBackupService; - private ObjectStorageBackupRetryScheduler scheduler; - - @BeforeEach - void setUp() { - objectStorageReplicaMapper = mock(ObjectStorageReplicaMapper.class); - objectStorageBackupService = mock(ObjectStorageBackupService.class); - scheduler = new ObjectStorageBackupRetryScheduler( - objectStorageReplicaMapper, - objectStorageBackupService, - objectStorageProperties() - ); - } - - @Test - void retryPendingOrFailedBackupsScansRetryableFilesAndDispatchesBackup() { - ObjectStorageReplicaDO pending = new ObjectStorageReplicaDO(); - pending.setFileId(1L); - ObjectStorageReplicaDO failed = new ObjectStorageReplicaDO(); - failed.setFileId(2L); - when(objectStorageReplicaMapper.selectList(any())).thenReturn(List.of(pending, failed)); - - scheduler.retryPendingOrFailedBackups(); - - @SuppressWarnings("unchecked") - ArgumentCaptor> captor = ArgumentCaptor.forClass(Wrapper.class); - verify(objectStorageReplicaMapper).selectList(captor.capture()); - assertThat(captor.getValue()).isNotNull(); - verify(objectStorageBackupService).backupFile(1L); - verify(objectStorageBackupService).backupFile(2L); - } - - private ObjectStorageProperties objectStorageProperties() { - ObjectStorageProperties properties = new ObjectStorageProperties(); - properties.setPrimaryProvider("QINIU_KODO"); - properties.setBackupProvider("ALIYUN_OSS"); - properties.setSignedUrlExpireMinutes(60); - properties.setBackupQueueName("test.queue"); - properties.setBackupExchangeName("test.exchange"); - properties.setBackupRoutingKey("test.routing"); - properties.setBackupRetryBatchLimit(500); - properties.setBackupRetryCron("0 0 2 * * ?"); - return properties; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageBackupServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageBackupServiceImplTest.java deleted file mode 100644 index 29e01c0d..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageBackupServiceImplTest.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.file.service.impl; - -import com.xiaowang.fingertipdesigner.core.modules.file.entity.ObjectStorageFileDO; -import com.xiaowang.fingertipdesigner.core.modules.file.mapper.ObjectStorageFileMapper; -import com.xiaowang.fingertipdesigner.core.modules.file.service.ObjectStorageFileService; -import com.xiaowang.fingertipdesigner.core.modules.file.service.ObjectStorageOrchestrationService; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class ObjectStorageBackupServiceImplTest { - - private ObjectStorageFileMapper objectStorageFileMapper; - private ObjectStorageOrchestrationService objectStorageOrchestrationService; - private ObjectStorageFileService objectStorageFileService; - private ObjectStorageBackupServiceImpl service; - - @BeforeEach - void setUp() { - objectStorageFileMapper = mock(ObjectStorageFileMapper.class); - objectStorageOrchestrationService = mock(ObjectStorageOrchestrationService.class); - objectStorageFileService = mock(ObjectStorageFileService.class); - service = new ObjectStorageBackupServiceImpl( - objectStorageFileMapper, - objectStorageOrchestrationService, - objectStorageFileService - ); - } - - @Test - void backupFileMarksFileSucceededAfterCompletingReplicas() { - ObjectStorageFileDO file = activePrimaryFile(); - when(objectStorageFileMapper.selectById(88L)).thenReturn(file); - - service.backupFile(88L); - - verify(objectStorageOrchestrationService).completeReplicas(file); - ArgumentCaptor captor = ArgumentCaptor.forClass(ObjectStorageFileDO.class); - verify(objectStorageFileMapper).updateById(captor.capture()); - ObjectStorageFileDO updated = captor.getValue(); - assertThat(updated.getId()).isEqualTo(88L); - assertThat(updated.getBackupUploadStatus()).isEqualTo(1); - assertThat(updated.getBackupUploadedAt()).isNotNull(); - assertThat(updated.getBackupLastError()).isNull(); - verify(objectStorageFileService).evictObjectStorageFileCache(88L); - } - - @Test - void backupFileMarksFileFailedAndTruncatesErrorWhenReplicaCompletionFails() { - ObjectStorageFileDO file = activePrimaryFile(); - file.setBackupRetryCount(2); - when(objectStorageFileMapper.selectById(88L)).thenReturn(file); - doThrow(new IllegalStateException("x".repeat(700))) - .when(objectStorageOrchestrationService) - .completeReplicas(file); - - service.backupFile(88L); - - ArgumentCaptor captor = ArgumentCaptor.forClass(ObjectStorageFileDO.class); - verify(objectStorageFileMapper).updateById(captor.capture()); - ObjectStorageFileDO updated = captor.getValue(); - assertThat(updated.getBackupUploadStatus()).isEqualTo(2); - assertThat(updated.getBackupRetryCount()).isEqualTo(3); - assertThat(updated.getBackupLastRetryTime()).isNotNull(); - assertThat(updated.getBackupLastError()).hasSizeLessThanOrEqualTo(500); - verify(objectStorageFileService).evictObjectStorageFileCache(88L); - } - - private ObjectStorageFileDO activePrimaryFile() { - ObjectStorageFileDO file = new ObjectStorageFileDO(); - file.setId(88L); - file.setStatus(1); - file.setObjectName("product/a.png"); - file.setPrimaryProvider("QINIU_KODO"); - file.setBackupProvider("ALIYUN_OSS"); - file.setPrimaryUploadStatus(1); - file.setBackupUploadStatus(0); - file.setContentType("image/png"); - file.setFileSize(3L); - return file; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageFileServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageFileServiceImplTest.java deleted file mode 100644 index 84233420..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageFileServiceImplTest.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.file.service.impl; - -import com.xiaowang.fingertipdesigner.core.config.AppCacheProperties; -import com.xiaowang.fingertipdesigner.core.config.ObjectStorageProperties; -import com.xiaowang.fingertipdesigner.core.modules.file.dto.ObjectStorageFileDTO; -import com.xiaowang.fingertipdesigner.core.modules.file.entity.ObjectStorageFileDO; -import com.xiaowang.fingertipdesigner.core.modules.file.mapper.ObjectStorageFileMapper; -import com.xiaowang.fingertipdesigner.core.modules.file.mq.ObjectStorageBackupMessagePublisher; -import com.xiaowang.fingertipdesigner.core.modules.file.service.ObjectStorageReplicaService; -import com.xiaowang.fingertipdesigner.core.support.cache.MultiLevelCacheService; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class ObjectStorageFileServiceImplTest { - - private ObjectStorageFileMapper objectStorageFileMapper; - private ObjectStorageBackupMessagePublisher objectStorageBackupMessagePublisher; - private ObjectStorageReplicaService objectStorageReplicaService; - private ObjectStorageFileServiceImpl service; - - @BeforeEach - void setUp() { - objectStorageFileMapper = mock(ObjectStorageFileMapper.class); - MultiLevelCacheService multiLevelCacheService = mock(MultiLevelCacheService.class); - AppCacheProperties appCacheProperties = new AppCacheProperties(); - objectStorageBackupMessagePublisher = mock(ObjectStorageBackupMessagePublisher.class); - objectStorageReplicaService = mock(ObjectStorageReplicaService.class); - service = new ObjectStorageFileServiceImpl( - objectStorageFileMapper, - multiLevelCacheService, - appCacheProperties, - objectStorageBackupMessagePublisher, - objectStorageProperties(), - objectStorageReplicaService - ); - } - - @Test - void createObjectStorageFilePublishesBackupMessageAfterPrimaryUploadSucceeded() { - when(objectStorageFileMapper.insert(any(ObjectStorageFileDO.class))).thenAnswer(invocation -> { - ObjectStorageFileDO file = invocation.getArgument(0); - file.setId(66L); - return 1; - }); - - ObjectStorageFileDTO dto = new ObjectStorageFileDTO(); - dto.setFileName("a.png"); - dto.setFileUrl("https://cdn.test/product/a.png"); - dto.setObjectName("product/a.png"); - dto.setPrimaryProvider("QINIU_KODO"); - dto.setPrimaryUrl(dto.getFileUrl()); - dto.setBackupProvider("ALIYUN_OSS"); - dto.setContentType("image/png"); - dto.setFileSize(3L); - dto.setStatus(1); - dto.setPrimaryUploadStatus(1); - dto.setBackupUploadStatus(0); - dto.setBackupRetryCount(0); - - Long fileId = service.createObjectStorageFile(dto); - - assertThat(fileId).isEqualTo(66L); - ArgumentCaptor captor = ArgumentCaptor.forClass(ObjectStorageFileDO.class); - verify(objectStorageFileMapper).insert(captor.capture()); - assertThat(captor.getValue().getObjectName()).isEqualTo("product/a.png"); - assertThat(captor.getValue().getPrimaryUploadStatus()).isEqualTo(1); - assertThat(captor.getValue().getBackupUploadStatus()).isEqualTo(0); - verify(objectStorageReplicaService).saveInitialReplicas(66L, dto.getUploadAttempts()); - verify(objectStorageBackupMessagePublisher).publish(66L); - } - - private ObjectStorageProperties objectStorageProperties() { - ObjectStorageProperties properties = new ObjectStorageProperties(); - properties.setPrimaryProvider("QINIU_KODO"); - properties.setBackupProvider("ALIYUN_OSS"); - properties.setSignedUrlExpireMinutes(60); - properties.setBackupQueueName("test.queue"); - properties.setBackupExchangeName("test.exchange"); - properties.setBackupRoutingKey("test.routing"); - properties.setBackupRetryBatchLimit(500); - properties.setBackupRetryCron("0 0 2 * * ?"); - return properties; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/support/ObjectStorageUrlSupportTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/support/ObjectStorageUrlSupportTest.java deleted file mode 100644 index f102419c..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/file/support/ObjectStorageUrlSupportTest.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.file.support; - -import com.xiaowang.fingertipdesigner.core.config.ObjectStorageProperties; -import com.xiaowang.fingertipdesigner.core.modules.file.config.QiniuKodoConfig; -import com.xiaowang.fingertipdesigner.core.modules.file.service.AliyunOssService; -import com.xiaowang.fingertipdesigner.core.modules.file.service.ObjectStorageOrchestrationService; -import com.xiaowang.fingertipdesigner.core.modules.file.service.PrimaryObjectStorageService; -import com.xiaowang.fingertipdesigner.core.modules.file.vo.ObjectStorageFileVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verifyNoInteractions; -import static org.mockito.Mockito.when; - -class ObjectStorageUrlSupportTest { - - private PrimaryObjectStorageService primaryObjectStorageService; - private AliyunOssService aliyunOssService; - private ObjectStorageOrchestrationService objectStorageOrchestrationService; - private ObjectStorageUrlSupport support; - - @BeforeEach - void setUp() { - primaryObjectStorageService = mock(PrimaryObjectStorageService.class); - aliyunOssService = mock(AliyunOssService.class); - objectStorageOrchestrationService = mock(ObjectStorageOrchestrationService.class); - - QiniuKodoConfig qiniuKodoConfig = new QiniuKodoConfig(); - qiniuKodoConfig.setDomain("https://cdn.test"); - - support = new ObjectStorageUrlSupport( - primaryObjectStorageService, - qiniuKodoConfig, - aliyunOssService, - objectStorageProperties(), - objectStorageOrchestrationService - ); - } - - @Test - void toAccessibleUrlFallsBackToOriginalExternalUrlWhenObjectNameCannotBeExtracted() { - String externalUrl = "https://acceptance.local/assets/product-a.jpg"; - - String result = support.toAccessibleUrl(externalUrl); - - assertThat(result).isEqualTo(externalUrl); - verifyNoInteractions(primaryObjectStorageService, aliyunOssService, objectStorageOrchestrationService); - } - - @Test - void extractObjectNameStillAcceptsRawObjectName() { - assertThat(support.extractObjectName("product/a.jpg?x=1")).isEqualTo("product/a.jpg"); - } - - @Test - void toAccessibleUrlMatchesHttpFileUrlWhenQiniuDomainMissesScheme() throws Exception { - QiniuKodoConfig qiniuKodoConfig = new QiniuKodoConfig(); - qiniuKodoConfig.setDomain("img.example.com"); - - ObjectStorageUrlSupport urlSupport = new ObjectStorageUrlSupport( - primaryObjectStorageService, - qiniuKodoConfig, - aliyunOssService, - objectStorageProperties(), - objectStorageOrchestrationService - ); - - when(objectStorageOrchestrationService.getPresignedUrl("product/a.jpg", 60)) - .thenReturn("http://img.example.com/product/a.jpg?e=1&token=test"); - - assertThat(urlSupport.toAccessibleUrl("http://img.example.com/product/a.jpg")) - .isEqualTo("http://img.example.com/product/a.jpg?e=1&token=test"); - } - - @Test - void toAccessibleUrlReturnsNullInsteadOfRawUrlWhenStringObjectSigningFails() throws Exception { - when(objectStorageOrchestrationService.getPresignedUrl("product/a.jpg", 60)) - .thenThrow(new IllegalStateException("primary down")); - - String result = support.toAccessibleUrl("https://cdn.test/product/a.jpg"); - - assertThat(result).isNull(); - } - - @Test - void toAccessibleUrlFallsBackToBackupSignedUrlWhenPrimarySigningFailsAndBackupSucceeded() throws Exception { - ObjectStorageFileVO file = new ObjectStorageFileVO(); - file.setId(12L); - file.setFileUrl("https://cdn.test/product/a.png"); - file.setPrimaryUrl("https://cdn.test/product/a.png"); - file.setObjectName("product/a.png"); - file.setBackupUploadStatus(1); - - when(objectStorageOrchestrationService.getPresignedUrl(12L, "product/a.png", 60)) - .thenThrow(new IllegalStateException("primary down")); - when(aliyunOssService.getPresignedUrl("product/a.png")).thenReturn("https://oss-signed.test/product/a.png"); - - String result = support.toAccessibleUrl(file); - - assertThat(result).isEqualTo("https://oss-signed.test/product/a.png"); - } - - @Test - void toAccessibleUrlReturnsNullInsteadOfRawObjectStorageUrlWhenBothBackendsAreUnavailable() throws Exception { - ObjectStorageFileVO file = new ObjectStorageFileVO(); - file.setId(12L); - file.setFileUrl("https://cdn.test/product/a.png"); - file.setPrimaryUrl("https://cdn.test/product/a.png"); - file.setObjectName("product/a.png"); - file.setBackupUploadStatus(1); - - when(objectStorageOrchestrationService.getPresignedUrl(12L, "product/a.png", 60)) - .thenThrow(new IllegalStateException("primary down")); - when(aliyunOssService.getPresignedUrl("product/a.png")).thenThrow(new IllegalStateException("backup down")); - - String result = support.toAccessibleUrl(file); - - assertThat(result).isNull(); - } - - @Test - void getSignedUrlOrThrowReportsClearFailureWhenBothBackendsAreUnavailable() throws Exception { - ObjectStorageFileVO file = new ObjectStorageFileVO(); - file.setId(12L); - file.setFileUrl("https://cdn.test/product/a.png"); - file.setObjectName("product/a.png"); - file.setBackupUploadStatus(1); - - when(objectStorageOrchestrationService.getPresignedUrl(12L, "product/a.png", 20)) - .thenThrow(new IllegalStateException("primary down")); - when(aliyunOssService.getPresignedUrl("product/a.png")).thenThrow(new IllegalStateException("backup down")); - - assertThatThrownBy(() -> support.getSignedUrlOrThrow(file, 20)) - .isInstanceOf(IllegalStateException.class) - .hasMessageContaining("No available object storage signed URL"); - } - - private ObjectStorageProperties objectStorageProperties() { - ObjectStorageProperties properties = new ObjectStorageProperties(); - properties.setPrimaryProvider("QINIU_KODO"); - properties.setBackupProvider("ALIYUN_OSS"); - properties.setSignedUrlExpireMinutes(60); - properties.setBackupQueueName("test.queue"); - properties.setBackupExchangeName("test.exchange"); - properties.setBackupRoutingKey("test.routing"); - properties.setBackupRetryBatchLimit(500); - properties.setBackupRetryCron("0 0 2 * * ?"); - return properties; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/BusinessEventOutboxServiceTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/BusinessEventOutboxServiceTest.java deleted file mode 100644 index b9f28b5a..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/BusinessEventOutboxServiceTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.integration.service.impl; - -import com.xiaowang.fingertipdesigner.core.modules.integration.entity.BusinessEventOutboxDO; -import com.xiaowang.fingertipdesigner.core.modules.integration.mapper.BusinessEventOutboxMapper; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.dao.DuplicateKeyException; -import org.springframework.scheduling.annotation.Scheduled; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class BusinessEventOutboxServiceTest { - - @Mock - private BusinessEventOutboxMapper outboxMapper; - - private BusinessEventOutboxServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new BusinessEventOutboxServiceImpl(outboxMapper); - } - - @Test - void enqueueOrderCompletedCreatesIdempotentEvent() { - service.enqueueOrderCompleted(1L); - - ArgumentCaptor captor = ArgumentCaptor.forClass(BusinessEventOutboxDO.class); - verify(outboxMapper).insert(captor.capture()); - BusinessEventOutboxDO event = captor.getValue(); - assertThat(event.getEventType()).isEqualTo("ORDER_COMPLETED"); - assertThat(event.getBusinessType()).isEqualTo("ORDER"); - assertThat(event.getBusinessId()).isEqualTo(1L); - assertThat(event.getEventKey()).isEqualTo("ORDER:1:COMPLETED"); - assertThat(event.getStatus()).isEqualTo("PENDING"); - assertThat(event.getPayloadJson()).contains("\"orderId\":1"); - } - - @Test - void duplicateOrderCompletedEventIsIgnored() { - when(outboxMapper.insert(any(BusinessEventOutboxDO.class))).thenThrow(new DuplicateKeyException("duplicate")); - - service.enqueueOrderCompleted(1L); - - verify(outboxMapper).insert(any(BusinessEventOutboxDO.class)); - } - - @Test - void processorPollsFrequentlyEnoughForOrderReviewPromptAcceptanceWindow() throws NoSuchMethodException { - Scheduled scheduled = BusinessEventOutboxProcessor.class.getMethod("processDueEvents") - .getAnnotation(Scheduled.class); - - assertThat(scheduled).isNotNull(); - assertThat(scheduled.fixedDelay()).isLessThanOrEqualTo(3000L); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MessageHubClientServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MessageHubClientServiceImplTest.java deleted file mode 100644 index 4a663efd..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MessageHubClientServiceImplTest.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.integration.service.impl; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.xiaowang.fingertipdesigner.core.config.BrandProperties; -import com.xiaowang.fingertipdesigner.core.modules.integration.entity.MessageHubPushConfigDO; -import com.xiaowang.fingertipdesigner.core.modules.integration.service.MessageHubPushConfigService; -import com.xiaowang.fingertipdesigner.core.support.id.TimeOrderedSnowflakeIdGenerator; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.amqp.core.Message; -import org.springframework.amqp.rabbit.core.RabbitTemplate; - -import java.nio.charset.StandardCharsets; -import java.util.Map; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class MessageHubClientServiceImplTest { - - private static final long ALIYUN_CHANNEL_ID = 314055468907909120L; - - @Mock - private RabbitTemplate rabbitTemplate; - - @Mock - private TimeOrderedSnowflakeIdGenerator snowflakeIdGenerator; - - @Mock - private MessageHubPushConfigService messageHubPushConfigService; - - @Mock - private BrandProperties brandProperties; - - private final ObjectMapper objectMapper = new ObjectMapper(); - - private MessageHubClientServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new MessageHubClientServiceImpl( - rabbitTemplate, - objectMapper, - snowflakeIdGenerator, - messageHubPushConfigService, - brandProperties - ); - when(snowflakeIdGenerator.nextIdString()).thenReturn("sms-message-1"); - } - - @Test - void registerVerificationMessageIncludesAliyunTemplateParameters() throws Exception { - String sceneCode = "USER_REGISTER_SMS_CODE"; - when(messageHubPushConfigService.getEnabledConfig(sceneCode)) - .thenReturn(aliyunConfig(sceneCode, "100001")); - - service.sendSmsVerificationCode(sceneCode, "13800138000", "123456"); - - Map messageBody = capturedMessageBody(); - assertThat(messageBody) - .containsEntry("templateCode", "100001") - .containsEntry("sourceSystem", "fingertipdesigner") - .containsEntry("sendMethod", "OTHER"); - assertThat(((Number) messageBody.get("channelId")).longValue()).isEqualTo(ALIYUN_CHANNEL_ID); - - Map templateParams = templateParams(messageBody); - assertThat(templateParams) - .containsEntry("code", "123456") - .containsEntry("min", "5") - .containsEntry("minutes", "5") - .containsEntry("number", "5"); - } - - @Test - void resetPasswordVerificationMessageUsesResetTemplateWithAliyunParameters() throws Exception { - String sceneCode = "USER_RESET_PASSWORD_SMS_CODE"; - when(messageHubPushConfigService.getEnabledConfig(sceneCode)) - .thenReturn(aliyunConfig(sceneCode, "100003")); - - service.sendSmsVerificationCode(sceneCode, "13800138000", "654321"); - - Map messageBody = capturedMessageBody(); - assertThat(messageBody).containsEntry("templateCode", "100003"); - assertThat(((Number) messageBody.get("channelId")).longValue()).isEqualTo(ALIYUN_CHANNEL_ID); - - Map templateParams = templateParams(messageBody); - assertThat(templateParams) - .containsEntry("code", "654321") - .containsEntry("min", "5") - .containsEntry("minutes", "5") - .containsEntry("number", "5"); - } - - private MessageHubPushConfigDO aliyunConfig(String sceneCode, String templateCode) { - MessageHubPushConfigDO config = new MessageHubPushConfigDO(); - config.setSceneCode(sceneCode); - config.setPlatform("SMS"); - config.setMsgType("VERIFICATION"); - config.setQueueName("smsQueue"); - config.setSourceSystem("fingertipdesigner"); - config.setTemplateCode(templateCode); - config.setChannelId(ALIYUN_CHANNEL_ID); - config.setSendMethod("OTHER"); - config.setEnabled(1); - config.setIsDelete(0); - return config; - } - - private Map capturedMessageBody() throws Exception { - ArgumentCaptor messageCaptor = ArgumentCaptor.forClass(Message.class); - verify(rabbitTemplate).convertAndSend(eq("smsQueue"), messageCaptor.capture()); - String jsonBody = new String(messageCaptor.getValue().getBody(), StandardCharsets.UTF_8); - return objectMapper.readValue(jsonBody, new TypeReference>() {}); - } - - @SuppressWarnings("unchecked") - private Map templateParams(Map messageBody) { - return (Map) messageBody.get("templateParams"); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniAuthServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniAuthServiceImplTest.java deleted file mode 100644 index 1638833d..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniAuthServiceImplTest.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.integration.service.impl; - -import com.baomidou.mybatisplus.core.MybatisConfiguration; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.core.metadata.TableInfoHelper; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.xiaowang.fingertipdesigner.core.common.BusinessException; -import com.xiaowang.fingertipdesigner.core.modules.integration.dto.WechatMiniAutoLoginRequestDTO; -import com.xiaowang.fingertipdesigner.core.modules.integration.dto.WechatMiniPhoneLoginRequestDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.integration.entity.WechatMiniBindingDO; -import com.xiaowang.fingertipdesigner.core.modules.user.mapper.UserMapper; -import com.xiaowang.fingertipdesigner.core.modules.integration.mapper.WechatMiniBindingMapper; -import com.xiaowang.fingertipdesigner.core.modules.user.service.UserService; -import com.xiaowang.fingertipdesigner.core.modules.integration.service.WechatMiniClientService; -import com.xiaowang.fingertipdesigner.core.modules.shop.support.UserShopBindingSupport; -import com.xiaowang.fingertipdesigner.core.support.id.TimeOrderedSnowflakeIdGenerator; -import com.xiaowang.fingertipdesigner.core.modules.shop.vo.ShopSimpleVO; -import com.xiaowang.fingertipdesigner.core.modules.integration.vo.WechatMiniLoginResultVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.data.redis.core.ValueOperations; -import org.apache.ibatis.builder.MapperBuilderAssistant; - -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import com.xiaowang.fingertipdesigner.core.common.Result; -class WechatMiniAuthServiceImplTest { - - @Mock - private WechatMiniClientService wechatMiniClientService; - - @Mock - private WechatMiniBindingMapper wechatMiniBindingMapper; - - @Mock - private UserMapper userMapper; - - @Mock - private UserService userService; - - @Mock - private UserShopBindingSupport userShopBindingSupport; - - @Mock - private StringRedisTemplate redisTemplate; - - @Mock - private ValueOperations valueOperations; - - private WechatMiniAuthServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - when(redisTemplate.opsForValue()).thenReturn(valueOperations); - initTableInfo(WechatMiniBindingDO.class); - initTableInfo(UserDO.class); - service = new WechatMiniAuthServiceImpl( - wechatMiniClientService, - wechatMiniBindingMapper, - userMapper, - userService, - userShopBindingSupport, - redisTemplate, - new ObjectMapper(), - new TimeOrderedSnowflakeIdGenerator(1704067200000L, 1L, 1L, "test-app") - ); - } - - private void initTableInfo(Class entityClass) { - MapperBuilderAssistant assistant = new MapperBuilderAssistant(new MybatisConfiguration(), ""); - assistant.setCurrentNamespace(entityClass.getName()); - TableInfoHelper.initTableInfo(assistant, entityClass); - } - - @Test - void autoLoginShouldDeactivateInvalidBindingAndFallbackToManualLogin() { - WechatMiniAutoLoginRequestDTO requestDTO = new WechatMiniAutoLoginRequestDTO(); - requestDTO.setWxCode("wx-code"); - when(wechatMiniClientService.code2Session("wx-code")) - .thenReturn(new WechatMiniClientService.SessionInfo("openid-1", "union-1", "session-1")); - - WechatMiniBindingDO bindingDO = new WechatMiniBindingDO(); - bindingDO.setId(100L); - bindingDO.setUserId(200L); - bindingDO.setStatus(1); - when(wechatMiniBindingMapper.selectOne(any(LambdaQueryWrapper.class))).thenReturn(bindingDO); - - UserDO deletedUser = new UserDO(); - deletedUser.setId(200L); - deletedUser.setIsDelete(1); - when(userMapper.selectById(200L)).thenReturn(deletedUser); - - WechatMiniLoginResultVO result = service.autoLogin(requestDTO); - - assertEquals(WechatMiniLoginResultVO.STATUS_NEED_MANUAL_LOGIN, result.getStatus()); - assertFalse(Boolean.TRUE.equals(result.getNewUser())); - verify(wechatMiniBindingMapper).update(eq(null), any(LambdaUpdateWrapper.class)); - } - - @Test - void phoneLoginShouldReturnSelectShopWhenNewWechatPhoneNeedsShopSelection() { - WechatMiniPhoneLoginRequestDTO requestDTO = new WechatMiniPhoneLoginRequestDTO(); - requestDTO.setWxCode("wx-code"); - requestDTO.setPhoneCode("phone-code"); - - when(wechatMiniClientService.code2Session("wx-code")) - .thenReturn(new WechatMiniClientService.SessionInfo("openid-2", "union-2", "session-2")); - when(wechatMiniClientService.getPhoneNumber("phone-code")).thenReturn("13800138000"); - when(wechatMiniBindingMapper.selectOne(any(LambdaQueryWrapper.class))).thenReturn(null); - when(userMapper.selectOne(any(LambdaQueryWrapper.class))).thenReturn(null); - when(userShopBindingSupport.listAllActiveShopOptions()).thenReturn(List.of( - new ShopSimpleVO(1L, "A 店"), - new ShopSimpleVO(2L, "B 店") - )); - - WechatMiniLoginResultVO result = service.phoneLogin(requestDTO); - - assertEquals(WechatMiniLoginResultVO.STATUS_SELECT_SHOP, result.getStatus()); - assertTrue(Boolean.TRUE.equals(result.getNewUser())); - assertEquals(2, result.getShops().size()); - } - - @Test - void ensureBindingShouldDeactivateHistoricalDuplicatesAndKeepSingleActiveRecord() { - when(wechatMiniClientService.getConfiguredAppId()).thenReturn("mini-app"); - - WechatMiniBindingDO currentBinding = new WechatMiniBindingDO(); - currentBinding.setId(1L); - currentBinding.setUserId(8L); - currentBinding.setOpenId("openid-3"); - currentBinding.setAppId("mini-app"); - currentBinding.setStatus(1); - - WechatMiniBindingDO duplicateBinding = new WechatMiniBindingDO(); - duplicateBinding.setId(2L); - duplicateBinding.setUserId(8L); - duplicateBinding.setOpenId("openid-legacy"); - duplicateBinding.setAppId("mini-app"); - duplicateBinding.setStatus(0); - - when(wechatMiniBindingMapper.selectList(any(LambdaQueryWrapper.class))) - .thenReturn(List.of(currentBinding), List.of(currentBinding, duplicateBinding)); - - service.ensureBinding(8L, "openid-3", "union-3"); - - verify(wechatMiniBindingMapper).updateById(currentBinding); - verify(wechatMiniBindingMapper).update(eq(null), any(LambdaUpdateWrapper.class)); - verify(wechatMiniBindingMapper, never()).insert(any(WechatMiniBindingDO.class)); - } - - @Test - void ensureBindingShouldRejectOtherUsersActiveBinding() { - when(wechatMiniClientService.getConfiguredAppId()).thenReturn("mini-app"); - - WechatMiniBindingDO activeBinding = new WechatMiniBindingDO(); - activeBinding.setId(11L); - activeBinding.setUserId(9L); - activeBinding.setOpenId("openid-4"); - activeBinding.setAppId("mini-app"); - activeBinding.setStatus(1); - - when(wechatMiniBindingMapper.selectList(any(LambdaQueryWrapper.class))) - .thenReturn(List.of(activeBinding), List.of()); - - BusinessException exception = assertThrows(BusinessException.class, () -> service.ensureBinding(8L, "openid-4", "union-4")); - assertEquals("当前微信已绑定其他账号,无法完成登录", exception.getMessage()); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniClientServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniClientServiceImplTest.java deleted file mode 100644 index 53262f36..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniClientServiceImplTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.integration.service.impl; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.xiaowang.fingertipdesigner.core.common.BusinessException; -import com.xiaowang.fingertipdesigner.core.config.WechatMiniProperties; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.data.redis.core.ValueOperations; -import org.springframework.http.HttpEntity; -import org.springframework.web.client.RestTemplate; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.when; - -class WechatMiniClientServiceImplTest { - - @Mock - private RestTemplate restTemplate; - - @Mock - private StringRedisTemplate redisTemplate; - - @Mock - private ValueOperations valueOperations; - - private WechatMiniClientServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - when(redisTemplate.opsForValue()).thenReturn(valueOperations); - WechatMiniProperties properties = new WechatMiniProperties(); - properties.setAppId("app-id"); - properties.setAppSecret("app-secret"); - service = new WechatMiniClientServiceImpl(restTemplate, redisTemplate, new ObjectMapper(), properties); - } - - @Test - void getPhoneNumberShouldFailWhenWechatResponseMissesPhoneInfo() { - when(valueOperations.get(anyString())).thenReturn(null); - when(restTemplate.getForObject(anyString(), any())).thenReturn("{\"access_token\":\"access-token\",\"expires_in\":7200}"); - when(restTemplate.postForObject(anyString(), any(HttpEntity.class), any())).thenReturn("{\"errcode\":0}"); - - BusinessException exception = assertThrows(BusinessException.class, () -> service.getPhoneNumber("phone-code")); - assertEquals("获取微信手机号失败:未返回手机号信息", exception.getMessage()); - } - - @Test - void code2SessionShouldFailWhenWechatResponseMissesOpenId() { - when(restTemplate.getForObject(anyString(), any())).thenReturn("{\"errcode\":0,\"session_key\":\"abc\"}"); - - BusinessException exception = assertThrows(BusinessException.class, () -> service.code2Session("wx-code")); - assertEquals("获取微信登录身份失败:缺少 openid", exception.getMessage()); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/manager/controller/admin/AdminManagerControllerTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/manager/controller/admin/AdminManagerControllerTest.java deleted file mode 100644 index c5a1d9e8..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/manager/controller/admin/AdminManagerControllerTest.java +++ /dev/null @@ -1,280 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.manager.controller.admin; - -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.ArtistScheduleDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.ArtistScheduleExceptionDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.ArtistScheduleRuleDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.NailArtistInfoDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.service.ArtistScheduleService; -import com.xiaowang.fingertipdesigner.core.modules.artist.service.NailArtistInfoService; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.ArtistScheduleExceptionVO; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.ArtistScheduleRuleSettingVO; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.ArtistScheduleRuleVO; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.ArtistScheduleVO; -import com.xiaowang.fingertipdesigner.core.modules.manager.dto.ManagerCustomerCreateDTO; -import com.xiaowang.fingertipdesigner.core.modules.planning.service.PlanningService; -import com.xiaowang.fingertipdesigner.core.modules.product.service.ProductService; -import com.xiaowang.fingertipdesigner.core.modules.product.vo.ProductVO; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.shop.dto.ShopDTO; -import com.xiaowang.fingertipdesigner.core.modules.shop.service.ShopService; -import com.xiaowang.fingertipdesigner.core.modules.shop.vo.ShopVO; -import com.xiaowang.fingertipdesigner.core.modules.user.dto.UserDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.user.service.UserService; -import com.xiaowang.fingertipdesigner.core.modules.user.vo.UserVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.web.bind.annotation.RequestMapping; - -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class AdminManagerControllerTest { - - @Mock - private PlanningService planningService; - - @Mock - private UserService userService; - - @Mock - private NailArtistInfoService nailArtistInfoService; - - @Mock - private ArtistScheduleService artistScheduleService; - - @Mock - private ProductService productService; - - @Mock - private ShopService shopService; - - @Mock - private AdminScopeHelper adminScopeHelper; - - private AdminManagerController controller; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - controller = new AdminManagerController(planningService, userService, nailArtistInfoService, artistScheduleService, productService, shopService, adminScopeHelper); - } - - @Test - void controllerShouldExposeManagerBoundary() { - RequestMapping mapping = AdminManagerController.class.getAnnotation(RequestMapping.class); - - assertThat(mapping.value()).containsExactly("/admin/manager"); - } - - @Test - void customersShouldResolveShopScopeAndForceCustomerType() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - manager.setType(2); - manager.setShopId(8L); - PageResultVO pageResult = new PageResultVO<>(); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - when(adminScopeHelper.resolveShopScope(manager, 99L)).thenReturn(8L); - when(userService.pageUsers(1, 10, "ann", 8L, 0, null, null, null, null, null, null, null, null, true)).thenReturn(pageResult); - - Result> result = controller.customers(request, 1, 10, "ann", 99L, true); - - assertThat(result.getData()).isSameAs(pageResult); - verify(adminScopeHelper).resolveShopScope(manager, 99L); - verify(userService).pageUsers(1, 10, "ann", 8L, 0, null, null, null, null, null, null, null, null, true); - } - - @Test - void createEmployeeUserShouldBindNonPlatformUserToManagedShop() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - manager.setType(2); - manager.setShopId(8L); - UserDTO dto = new UserDTO(); - dto.setType(3); - dto.setShopId(99L); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - when(adminScopeHelper.isPlatformAdmin(manager)).thenReturn(false); - when(adminScopeHelper.getManagedShopId(manager)).thenReturn(8L); - when(userService.createUser(dto)).thenReturn(101L); - - Result result = controller.createEmployeeUser(request, dto); - - assertThat(result.getData()).isEqualTo(101L); - assertThat(dto.getShopId()).isEqualTo(8L); - assertThat(dto.getShopIds()).containsExactly(8L); - verify(adminScopeHelper).ensureAssignableUserType(manager, 3); - } - - @Test - void createEmployeeUserShouldForceNailArtistType() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - manager.setType(2); - UserDTO dto = new UserDTO(); - dto.setType(0); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - when(adminScopeHelper.isPlatformAdmin(manager)).thenReturn(true); - when(userService.createUser(dto)).thenReturn(102L); - - Result result = controller.createEmployeeUser(request, dto); - - assertThat(result.getData()).isEqualTo(102L); - assertThat(dto.getType()).isEqualTo(3); - verify(adminScopeHelper).ensureAssignableUserType(manager, 3); - } - - @Test - void createCustomerShouldForceNormalUserInCurrentShop() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - manager.setType(2); - ManagerCustomerCreateDTO dto = new ManagerCustomerCreateDTO(); - dto.setNickname(" 小王客户 "); - dto.setPhone(" 13800138000 "); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - when(adminScopeHelper.resolveShopScope(manager, null)).thenReturn(8L); - when(userService.createUser(any(UserDTO.class))).thenReturn(103L); - - Result result = controller.createCustomer(request, dto); - - assertThat(result.getData()).isEqualTo(103L); - verify(adminScopeHelper).requireShopContext(manager, "请先选择店铺后再新增客户"); - verify(userService).createUser(org.mockito.ArgumentMatchers.argThat(userDTO -> - "小王客户".equals(userDTO.getNickname()) - && "13800138000".equals(userDTO.getPhone()) - && "13800138000".equals(userDTO.getContactPhone()) - && "13800138000".equals(userDTO.getAccount()) - && Integer.valueOf(0).equals(userDTO.getType()) - && Long.valueOf(8L).equals(userDTO.getShopId()) - && userDTO.getShopIds().equals(List.of(8L)) - && "普通".equals(userDTO.getLevel()) - && Long.valueOf(0L).equals(userDTO.getVipId()) - )); - } - - @Test - void saveScheduleShouldResolveShopScopeBeforeSaving() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - ArtistScheduleDTO dto = new ArtistScheduleDTO(); - dto.setShopId(99L); - ArtistScheduleVO vo = new ArtistScheduleVO(); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - when(adminScopeHelper.resolveShopScope(manager, 99L)).thenReturn(8L); - when(artistScheduleService.saveSchedule(dto)).thenReturn(vo); - - Result result = controller.saveSchedule(request, dto); - - assertThat(result.getData()).isSameAs(vo); - assertThat(dto.getShopId()).isEqualTo(8L); - } - - @Test - void scheduleRuleShouldResolveShopScopeBeforeReading() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - ArtistScheduleRuleSettingVO vo = new ArtistScheduleRuleSettingVO(); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - when(adminScopeHelper.resolveShopScope(manager, null)).thenReturn(8L); - when(artistScheduleService.getRuleSetting(8L, 30L)).thenReturn(vo); - - Result result = controller.scheduleRule(request, 30L); - - assertThat(result.getData()).isSameAs(vo); - verify(artistScheduleService).getRuleSetting(8L, 30L); - } - - @Test - void saveScheduleRuleShouldResolveShopScopeBeforeSaving() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - ArtistScheduleRuleDTO dto = new ArtistScheduleRuleDTO(); - dto.setShopId(99L); - ArtistScheduleRuleVO vo = new ArtistScheduleRuleVO(); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - when(adminScopeHelper.resolveShopScope(manager, 99L)).thenReturn(8L); - when(artistScheduleService.saveRule(dto)).thenReturn(vo); - - Result result = controller.saveScheduleRule(request, dto); - - assertThat(result.getData()).isSameAs(vo); - assertThat(dto.getShopId()).isEqualTo(8L); - } - - @Test - void saveScheduleExceptionShouldResolveShopScopeBeforeSaving() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - ArtistScheduleExceptionDTO dto = new ArtistScheduleExceptionDTO(); - dto.setShopId(99L); - ArtistScheduleExceptionVO vo = new ArtistScheduleExceptionVO(); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - when(adminScopeHelper.resolveShopScope(manager, 99L)).thenReturn(8L); - when(artistScheduleService.saveException(dto)).thenReturn(vo); - - Result result = controller.saveScheduleException(request, dto); - - assertThat(result.getData()).isSameAs(vo); - assertThat(dto.getShopId()).isEqualTo(8L); - } - - @Test - void updateShopShouldPreserveAuthorizationExpireTimeForNonPlatformUser() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - ShopDTO dto = new ShopDTO(); - ShopVO shop = new ShopVO(); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - when(adminScopeHelper.resolveShopScope(manager, null)).thenReturn(8L); - when(shopService.getShopById(8L)).thenReturn(shop); - when(adminScopeHelper.isPlatformAdmin(manager)).thenReturn(false); - when(shopService.updateShop(8L, dto)).thenReturn(true); - - Result result = controller.updateShop(request, dto); - - assertThat(result.getData()).isTrue(); - verify(adminScopeHelper).requireShopContext(manager); - verify(shopService).updateShop(8L, dto); - } - - @Test - void employeesShouldReturnScopedArtistsForNonPlatformUser() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - List artists = List.of(new NailArtistInfoDTO()); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - when(adminScopeHelper.isPlatformAdmin(manager)).thenReturn(false); - when(adminScopeHelper.resolveShopScope(manager, null)).thenReturn(8L); - when(nailArtistInfoService.getByShopId(8L)).thenReturn(artists); - - Result> result = controller.employees(request); - - assertThat(result.getData()).isSameAs(artists); - } - - @Test - void productsShouldResolveShopScope() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - PageResultVO pageResult = new PageResultVO<>(); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - when(adminScopeHelper.resolveShopScope(manager, 99L)).thenReturn(8L); - when(productService.pageProducts(1, 10, "gel", 8L, null, null, null, null, null)).thenReturn(pageResult); - - Result> result = controller.products(request, 1, 10, "gel", 99L, null, null, null, null, null); - - assertThat(result.getData()).isSameAs(pageResult); - verify(productService).pageProducts(1, 10, "gel", 8L, null, null, null, null, null); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/WishlistServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/WishlistServiceImplTest.java deleted file mode 100644 index 56660bfe..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/WishlistServiceImplTest.java +++ /dev/null @@ -1,208 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.marketing.service.impl; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.xiaowang.fingertipdesigner.core.modules.marketing.dto.WishlistAddWithGroupDTO; -import com.xiaowang.fingertipdesigner.core.modules.marketing.dto.WishlistMoveDTO; -import com.xiaowang.fingertipdesigner.core.modules.marketing.dto.WishlistGroupDTO; -import com.xiaowang.fingertipdesigner.core.modules.product.entity.ProductDO; -import com.xiaowang.fingertipdesigner.core.modules.marketing.entity.WishlistDO; -import com.xiaowang.fingertipdesigner.core.modules.marketing.entity.WishlistGroupDO; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.ProductMapper; -import com.xiaowang.fingertipdesigner.core.modules.marketing.mapper.WishlistGroupMapper; -import com.xiaowang.fingertipdesigner.core.modules.marketing.mapper.WishlistMapper; -import com.xiaowang.fingertipdesigner.core.modules.product.service.ProductService; -import com.xiaowang.fingertipdesigner.core.modules.product.vo.ProductVO; -import com.xiaowang.fingertipdesigner.core.modules.marketing.vo.WishlistGroupVO; -import com.xiaowang.fingertipdesigner.core.modules.marketing.vo.WishlistInspirationVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; - -import java.math.BigDecimal; -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class WishlistServiceImplTest { - - private static final String RECENT_GROUP = "\u6700\u8fd1\u60f3\u505a"; - private static final String WEDDING_GROUP = "\u5a5a\u793c\u6b3e"; - private static final String SUMMER_GROUP = "\u590f\u5929\u6b3e"; - - private WishlistMapper wishlistMapper; - private WishlistGroupMapper wishlistGroupMapper; - private ProductMapper productMapper; - private ProductService productService; - private WishlistServiceImpl service; - - @BeforeEach - void setUp() { - wishlistMapper = mock(WishlistMapper.class); - wishlistGroupMapper = mock(WishlistGroupMapper.class); - productMapper = mock(ProductMapper.class); - productService = mock(ProductService.class); - service = new WishlistServiceImpl(wishlistMapper, wishlistGroupMapper, productService, productMapper); - } - - @Test - void listGroupsCreatesPresetGroupsForNewUser() { - when(wishlistGroupMapper.selectList(any(Wrapper.class))).thenReturn(List.of()); - - List groups = service.listGroups(88L); - - ArgumentCaptor captor = ArgumentCaptor.forClass(WishlistGroupDO.class); - verify(wishlistGroupMapper, org.mockito.Mockito.times(3)).insert(captor.capture()); - assertThat(captor.getAllValues()) - .extracting(WishlistGroupDO::getName) - .containsExactly(RECENT_GROUP, WEDDING_GROUP, SUMMER_GROUP); - assertThat(groups).extracting(WishlistGroupVO::getName) - .containsExactly(RECENT_GROUP, WEDDING_GROUP, SUMMER_GROUP); - } - - @Test - void addWithGroupCreatesWishlistEntryWithGroupMetadata() { - ProductDO product = new ProductDO(); - product.setId(9L); - product.setIsDelete(0); - when(productMapper.selectById(9L)).thenReturn(product); - when(wishlistGroupMapper.selectById(3L)).thenReturn(group(3L, 88L, WEDDING_GROUP, 20)); - when(wishlistMapper.selectOne(any(Wrapper.class))).thenReturn(null); - - WishlistAddWithGroupDTO request = new WishlistAddWithGroupDTO(); - request.setProductId(9L); - request.setGroupId(3L); - request.setNote("Ask for pearl accent"); - request.setSortOrder(7); - service.addToWishlist(88L, request); - - ArgumentCaptor captor = ArgumentCaptor.forClass(WishlistDO.class); - verify(wishlistMapper).insert(captor.capture()); - assertThat(captor.getValue().getUserId()).isEqualTo(88L); - assertThat(captor.getValue().getProductId()).isEqualTo(9L); - assertThat(captor.getValue().getGroupId()).isEqualTo(3L); - assertThat(captor.getValue().getNote()).isEqualTo("Ask for pearl accent"); - assertThat(captor.getValue().getSortOrder()).isEqualTo(7); - verify(productMapper).incrementCollectCount(9L); - } - - @Test - void addWithGroupUpdatesExistingWishlistWithoutIncrementingCollectCount() { - ProductDO product = new ProductDO(); - product.setId(9L); - product.setIsDelete(0); - WishlistDO existing = new WishlistDO(); - existing.setId(11L); - existing.setUserId(88L); - existing.setProductId(9L); - when(productMapper.selectById(9L)).thenReturn(product); - when(wishlistGroupMapper.selectById(3L)).thenReturn(group(3L, 88L, WEDDING_GROUP, 20)); - when(wishlistMapper.selectOne(any(Wrapper.class))).thenReturn(existing); - - WishlistAddWithGroupDTO request = new WishlistAddWithGroupDTO(); - request.setProductId(9L); - request.setGroupId(3L); - request.setNote("Move to wedding board"); - service.addToWishlist(88L, request); - - assertThat(existing.getGroupId()).isEqualTo(3L); - assertThat(existing.getNote()).isEqualTo("Move to wedding board"); - verify(wishlistMapper).updateById(existing); - verify(productMapper, never()).incrementCollectCount(9L); - } - - @Test - void moveWishlistChangesGroupNoteAndOrder() { - WishlistDO existing = new WishlistDO(); - existing.setId(11L); - existing.setUserId(88L); - existing.setProductId(9L); - when(wishlistMapper.selectOne(any(Wrapper.class))).thenReturn(existing); - when(wishlistGroupMapper.selectById(2L)).thenReturn(group(2L, 88L, SUMMER_GROUP, 30)); - - WishlistMoveDTO request = new WishlistMoveDTO(); - request.setProductId(9L); - request.setGroupId(2L); - request.setNote("Try blue"); - request.setSortOrder(4); - service.moveWishlist(88L, request); - - assertThat(existing.getGroupId()).isEqualTo(2L); - assertThat(existing.getNote()).isEqualTo("Try blue"); - assertThat(existing.getSortOrder()).isEqualTo(4); - verify(wishlistMapper).updateById(existing); - } - - @Test - void inspirationGroupsWishlistItemsByGroupAndKeepsUngroupedInDefaultGroup() { - WishlistGroupDO recent = group(1L, 88L, RECENT_GROUP, 10); - WishlistGroupDO summer = group(2L, 88L, SUMMER_GROUP, 30); - WishlistDO grouped = wishlist(101L, 88L, 9L, 2L, "Try blue", 4); - WishlistDO legacy = wishlist(102L, 88L, 10L, null, null, 0); - when(wishlistGroupMapper.selectList(any(Wrapper.class))).thenReturn(List.of(recent, summer)); - when(wishlistMapper.selectList(any(Wrapper.class))).thenReturn(List.of(grouped, legacy)); - when(productService.getProductById(9L)).thenReturn(product(9L, "Ocean glass")); - when(productService.getProductById(10L)).thenReturn(product(10L, "Plain nude")); - - WishlistInspirationVO inspiration = service.getInspiration(88L); - - assertThat(inspiration.getTotal()).isEqualTo(2); - assertThat(inspiration.getGroups()).extracting(WishlistGroupVO::getName) - .containsExactly(RECENT_GROUP, WEDDING_GROUP, SUMMER_GROUP); - assertThat(inspiration.getGroups().get(0).getItems()) - .extracting(item -> item.getProduct().getTitle()) - .containsExactly("Plain nude"); - assertThat(inspiration.getGroups().get(1).getItems()).isEmpty(); - assertThat(inspiration.getGroups().get(2).getItems()) - .extracting(item -> item.getProduct().getTitle()) - .containsExactly("Ocean glass"); - } - - @Test - void createGroupNormalizesNameAndSortOrder() { - WishlistGroupDTO request = new WishlistGroupDTO(); - request.setName(" Bride ideas "); - - service.createGroup(88L, request); - - ArgumentCaptor captor = ArgumentCaptor.forClass(WishlistGroupDO.class); - verify(wishlistGroupMapper).insert(captor.capture()); - assertThat(captor.getValue().getName()).isEqualTo("Bride ideas"); - assertThat(captor.getValue().getSortOrder()).isEqualTo(100); - assertThat(captor.getValue().getIsDelete()).isZero(); - } - - private WishlistGroupDO group(Long id, Long userId, String name, Integer sortOrder) { - WishlistGroupDO group = new WishlistGroupDO(); - group.setId(id); - group.setUserId(userId); - group.setName(name); - group.setSortOrder(sortOrder); - group.setIsDelete(0); - return group; - } - - private WishlistDO wishlist(Long id, Long userId, Long productId, Long groupId, String note, Integer sortOrder) { - WishlistDO wishlist = new WishlistDO(); - wishlist.setId(id); - wishlist.setUserId(userId); - wishlist.setProductId(productId); - wishlist.setGroupId(groupId); - wishlist.setNote(note); - wishlist.setSortOrder(sortOrder); - wishlist.setIsDelete(0); - return wishlist; - } - - private ProductVO product(Long id, String title) { - ProductVO product = new ProductVO(); - product.setId(id); - product.setTitle(title); - product.setPrice(new BigDecimal("168.00")); - return product; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/admin/AdminOrderControllerTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/admin/AdminOrderControllerTest.java deleted file mode 100644 index ab9d8182..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/admin/AdminOrderControllerTest.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.order.controller.admin; - -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.order.service.OrderService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.order.vo.OrderVO; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.web.bind.annotation.RequestParam; - -import java.lang.reflect.Method; -import java.lang.reflect.Parameter; -import java.util.Arrays; -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.mockito.Mockito.doThrow; - -class AdminOrderControllerTest { - - @Mock - private OrderService orderService; - - @Mock - private AdminScopeHelper adminScopeHelper; - - private AdminOrderController controller; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - controller = new AdminOrderController(orderService, adminScopeHelper); - } - - @Test - void listOrdersShouldAcceptShopFilterAndResolveScopeOnServer() throws Exception { - Method method = Arrays.stream(AdminOrderController.class.getDeclaredMethods()) - .filter(candidate -> "listOrders".equals(candidate.getName())) - .filter(candidate -> Arrays.stream(candidate.getParameters()).anyMatch(this::isShopIdRequestParam)) - .findFirst() - .orElseThrow(() -> new AssertionError("listOrders must expose optional shopId request parameter")); - - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO platformAdmin = new UserDO(); - platformAdmin.setType(4); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(platformAdmin); - when(adminScopeHelper.resolveShopScope(platformAdmin, 8L)).thenReturn(8L); - - OrderVO visibleOrder = order(8L); - OrderVO hiddenOrder = order(9L); - when(orderService.getAllOrders()).thenReturn(List.of(visibleOrder, hiddenOrder)); - - @SuppressWarnings("unchecked") - Result> result = (Result>) method.invoke(controller, request, 1, 10, null, 8L, null); - - verify(adminScopeHelper).resolveShopScope(platformAdmin, 8L); - assertThat(result.getData().getList()).containsExactly(visibleOrder); - } - - @Test - void getOrderDetailShouldReturnVisibleOrderForAdmin() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO platformAdmin = new UserDO(); - platformAdmin.setType(4); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(platformAdmin); - - OrderVO visibleOrder = order(8L); - when(orderService.getAllOrders()).thenReturn(List.of(visibleOrder)); - - Result result = controller.getOrderDetail(request, visibleOrder.getId()); - - assertThat(result.getData()).isSameAs(visibleOrder); - } - - @Test - void getOrderDetailShouldRejectOtherShopForManager() { - MockHttpServletRequest request = new MockHttpServletRequest(); - UserDO manager = new UserDO(); - manager.setType(2); - manager.setShopId(8L); - when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager); - - OrderVO otherShopOrder = order(9L); - when(orderService.getAllOrders()).thenReturn(List.of(otherShopOrder)); - doThrow(new RuntimeException("无权查看其他店铺订单")) - .when(adminScopeHelper) - .ensureShopAccessible(manager, otherShopOrder.getShopId(), "无权查看其他店铺订单"); - - assertThatThrownBy(() -> controller.getOrderDetail(request, otherShopOrder.getId())) - .isInstanceOf(RuntimeException.class) - .hasMessageContaining("无权查看其他店铺订单"); - } - - private boolean isShopIdRequestParam(Parameter parameter) { - RequestParam requestParam = parameter.getAnnotation(RequestParam.class); - return requestParam != null && Long.class.equals(parameter.getType()); - } - - private OrderVO order(Long shopId) { - OrderVO order = new OrderVO(); - order.setId(shopId); - order.setShopId(shopId); - return order; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/AfterSaleServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/AfterSaleServiceImplTest.java deleted file mode 100644 index 2bbcbf97..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/AfterSaleServiceImplTest.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.order.service.impl; - -import com.xiaowang.fingertipdesigner.core.modules.order.dto.AfterSaleApplyDTO; -import com.xiaowang.fingertipdesigner.core.modules.order.dto.AfterSaleAuditDTO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.AfterSaleDO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.AfterSaleLogDO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderDO; -import com.xiaowang.fingertipdesigner.core.modules.message.entity.SystemMessageDO; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.AfterSaleLogMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.AfterSaleMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderMapper; -import com.xiaowang.fingertipdesigner.core.modules.message.mapper.SystemMessageMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.vo.AfterSaleVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - -import java.math.BigDecimal; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import com.xiaowang.fingertipdesigner.core.common.Result; -class AfterSaleServiceImplTest { - - @Mock - private AfterSaleMapper afterSaleMapper; - @Mock - private AfterSaleLogMapper afterSaleLogMapper; - @Mock - private OrderMapper orderMapper; - @Mock - private SystemMessageMapper systemMessageMapper; - - private AfterSaleServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new AfterSaleServiceImpl(afterSaleMapper, afterSaleLogMapper, orderMapper, systemMessageMapper); - } - - @Test - void applyCreatesPendingAfterSaleForOwnedOrder() { - OrderDO order = order(); - when(orderMapper.selectById(1L)).thenReturn(order); - when(afterSaleMapper.insert(any(AfterSaleDO.class))).thenAnswer(invocation -> { - AfterSaleDO afterSale = invocation.getArgument(0); - afterSale.setId(100L); - return 1; - }); - - AfterSaleApplyDTO dto = new AfterSaleApplyDTO(); - dto.setOrderId(1L); - dto.setType("REFUND_CONSULT"); - dto.setReason("Need help"); - dto.setRefundAmount(new BigDecimal("20.00")); - - AfterSaleVO result = service.apply(2L, dto); - - assertThat(result.getStatus()).isEqualTo("PENDING"); - ArgumentCaptor logCaptor = ArgumentCaptor.forClass(AfterSaleLogDO.class); - verify(afterSaleLogMapper).insert(logCaptor.capture()); - assertThat(logCaptor.getValue().getAction()).isEqualTo("CREATE"); - } - - @Test - void approveChangesStatusAndNotifiesCustomer() { - AfterSaleDO afterSale = new AfterSaleDO(); - afterSale.setId(100L); - afterSale.setOrderId(1L); - afterSale.setUserId(2L); - afterSale.setShopId(9L); - afterSale.setStatus("PENDING"); - when(afterSaleMapper.selectById(100L)).thenReturn(afterSale); - - AfterSaleAuditDTO dto = new AfterSaleAuditDTO(); - dto.setAuditReason("OK"); - AfterSaleVO result = service.approve(900L, 100L, dto); - - assertThat(result.getStatus()).isEqualTo("APPROVED"); - verify(afterSaleMapper).updateById(afterSale); - verify(systemMessageMapper).insert(any(SystemMessageDO.class)); - } - - private OrderDO order() { - OrderDO order = new OrderDO(); - order.setId(1L); - order.setOrderNo("ORD1"); - order.setUserId(2L); - order.setShopId(9L); - order.setActualAmount(new BigDecimal("88.00")); - order.setStatus(1); - order.setIsDelete(0); - return order; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/OrderServiceImplCheckoutPreviewTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/OrderServiceImplCheckoutPreviewTest.java deleted file mode 100644 index 1326b89a..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/OrderServiceImplCheckoutPreviewTest.java +++ /dev/null @@ -1,296 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.order.service.impl; - -import com.xiaowang.fingertipdesigner.core.common.BusinessException; -import com.xiaowang.fingertipdesigner.core.modules.order.dto.CheckoutPreviewDTO; -import com.xiaowang.fingertipdesigner.core.modules.order.dto.OrderItemDTO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.CartDO; -import com.xiaowang.fingertipdesigner.core.modules.marketing.entity.CouponDO; -import com.xiaowang.fingertipdesigner.core.modules.shop.entity.ShopDO; -import com.xiaowang.fingertipdesigner.core.modules.product.entity.ProductDO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.CartMapper; -import com.xiaowang.fingertipdesigner.core.modules.marketing.mapper.CouponMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderItemMapper; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.ProductMapper; -import com.xiaowang.fingertipdesigner.core.modules.shop.mapper.ShopMapper; -import com.xiaowang.fingertipdesigner.core.modules.user.mapper.UserMapper; -import com.xiaowang.fingertipdesigner.core.modules.planning.mapper.AppointmentReservationMapper; -import com.xiaowang.fingertipdesigner.core.modules.planning.service.AppointmentCapacityService; -import com.xiaowang.fingertipdesigner.core.modules.marketing.service.CouponService; -import com.xiaowang.fingertipdesigner.core.modules.artist.support.BookableArtistSupport; -import com.xiaowang.fingertipdesigner.core.modules.shop.support.UserShopBindingSupport; -import com.xiaowang.fingertipdesigner.core.modules.order.vo.CheckoutPreviewVO; -import com.xiaowang.fingertipdesigner.core.modules.marketing.vo.UserCouponVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.test.util.ReflectionTestUtils; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.verifyNoInteractions; -import static org.mockito.Mockito.when; - -class OrderServiceImplCheckoutPreviewTest { - - @Mock - private ProductMapper productMapper; - @Mock - private CartMapper cartMapper; - @Mock - private CouponMapper couponMapper; - @Mock - private OrderItemMapper orderItemMapper; - @Mock - private UserMapper userMapper; - @Mock - private ShopMapper shopMapper; - @Mock - private CouponService couponService; - @Mock - private BookableArtistSupport bookableArtistSupport; - @Mock - private UserShopBindingSupport userShopBindingSupport; - @Mock - private AppointmentCapacityService appointmentCapacityService; - @Mock - private AppointmentReservationMapper appointmentReservationMapper; - - private OrderServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new OrderServiceImpl(); - ReflectionTestUtils.setField(service, "productMapper", productMapper); - ReflectionTestUtils.setField(service, "cartMapper", cartMapper); - ReflectionTestUtils.setField(service, "couponMapper", couponMapper); - ReflectionTestUtils.setField(service, "orderItemMapper", orderItemMapper); - ReflectionTestUtils.setField(service, "userMapper", userMapper); - ReflectionTestUtils.setField(service, "shopMapper", shopMapper); - ReflectionTestUtils.setField(service, "couponService", couponService); - ReflectionTestUtils.setField(service, "bookableArtistSupport", bookableArtistSupport); - ReflectionTestUtils.setField(service, "userShopBindingSupport", userShopBindingSupport); - ReflectionTestUtils.setField(service, "appointmentCapacityService", appointmentCapacityService); - ReflectionTestUtils.setField(service, "appointmentReservationMapper", appointmentReservationMapper); - } - - @Test - void checkoutPreviewExplainsBestAvailableCouponAndUnavailableReasons() { - ProductDO product = product(100L, "温柔法式", "法式,通勤", new BigDecimal("100.00")); - CartDO cartItem = cartItem(100L, 2); - UserCouponVO vipCoupon = couponOption(300L, 300L, "SYSTEM_VIP", "黄金VIP自动90折券", 1, "9.0", null, null); - UserCouponVO userCoupon = couponOption(400L, 500L, "USER_COUPON", "满150减30", 2, null, "150.00", "30.00"); - - when(productMapper.selectById(100L)).thenReturn(product); - when(cartMapper.selectByUserIdAndProductId(20L, 100L)).thenReturn(cartItem); - when(userMapper.selectById(20L)).thenReturn(user("黄金")); - when(userMapper.selectById(30L)).thenReturn(artist(30L)); - when(bookableArtistSupport.isBookableServiceUser(any(UserDO.class))).thenReturn(true); - when(userShopBindingSupport.canUserAccessShop(20L, 9L, false, null)).thenReturn(true); - when(userShopBindingSupport.isUserAccessibleInShop(30L, 9L)).thenReturn(true); - when(couponService.getAvailableCoupons(20L, "法式,通勤", 200.0, 9L)).thenReturn(List.of(userCoupon, vipCoupon)); - when(couponMapper.selectById(300L)).thenReturn(coupon(300L, "黄金VIP自动90折券", 1, new BigDecimal("9.0"), null, null, 9L)); - when(couponMapper.selectById(400L)).thenReturn(coupon(400L, "满150减30", 2, null, new BigDecimal("150.00"), new BigDecimal("30.00"), 9L)); - when(couponMapper.selectList(any())).thenReturn(List.of( - coupon(600L, "满300减80", 2, null, new BigDecimal("300.00"), new BigDecimal("80.00"), 9L), - coupon(700L, "其他门店券", 2, null, new BigDecimal("50.00"), new BigDecimal("5.00"), 10L) - )); - - CheckoutPreviewVO preview = service.checkoutPreview(20L, order(100L, 2)); - - assertThat(preview.getSubtotalAmount()).isEqualByComparingTo("200.00"); - assertThat(preview.getSavedAmount()).isEqualByComparingTo("30.00"); - assertThat(preview.getPayableAmount()).isEqualByComparingTo("170.00"); - assertThat(preview.getBestCoupon().getCouponName()).isEqualTo("满150减30"); - assertThat(preview.getAvailableCoupons()).extracting("couponName") - .containsExactly("满150减30", "黄金VIP自动90折券"); - assertThat(preview.getUnavailableCoupons()).extracting("couponName") - .containsExactly("满300减80", "其他门店券"); - assertThat(preview.getUnavailableCoupons()).extracting("unavailableReason") - .containsExactly("还差 ¥100.00 可用", "仅限其他门店使用"); - assertThat(preview.getVipTip()).isEqualTo("黄金VIP本单可省 ¥20.00,已为你计算。"); - assertThat(preview.getSummaryText()).isEqualTo("参考价小计 ¥200.00,预估优惠 ¥30.00,预估应付 ¥170.00。"); - assertThat(ReflectionTestUtils.getField(preview, "bookingAvailable")).isEqualTo(true); - assertThat((List) ReflectionTestUtils.getField(preview, "bookingIssues")).isEmpty(); - } - - @Test - void checkoutPreviewReportsBookingIssuesWithoutReservingCapacity() { - ProductDO product = product(100L, "夜间款", "通勤", new BigDecimal("80.00")); - product.setApproximateDuration("60分钟"); - product.setBookableArtists("77"); - CartDO cartItem = cartItem(100L, 1); - LocalDateTime appointmentTime = LocalDateTime.now().plusDays(1) - .withHour(17) - .withMinute(30) - .withSecond(0) - .withNano(0); - - when(productMapper.selectById(100L)).thenReturn(product); - when(cartMapper.selectByUserIdAndProductId(20L, 100L)).thenReturn(cartItem); - when(userMapper.selectById(77L)).thenReturn(artist(77L)); - when(bookableArtistSupport.isBookableServiceUser(any(UserDO.class))).thenReturn(true); - when(userShopBindingSupport.canUserAccessShop(20L, 9L, false, null)).thenReturn(true); - when(userShopBindingSupport.isUserAccessibleInShop(77L, 9L)).thenReturn(true); - when(shopMapper.selectById(9L)).thenReturn(shop("09:00-18:00")); - when(couponService.getAvailableCoupons(20L, "通勤", 80.0, 9L)).thenReturn(List.of()); - when(couponMapper.selectList(any())).thenReturn(List.of()); - - CheckoutPreviewVO preview = service.checkoutPreview(20L, order(100L, 1, 77L, appointmentTime)); - - assertThat(preview.getSubtotalAmount()).isEqualByComparingTo("80.00"); - assertThat(ReflectionTestUtils.getField(preview, "bookingAvailable")).isEqualTo(false); - List bookingIssues = (List) ReflectionTestUtils.getField(preview, "bookingIssues"); - assertThat(bookingIssues).hasSize(1); - Object issue = bookingIssues.get(0); - assertThat(ReflectionTestUtils.getField(issue, "code")).isEqualTo("BUSINESS_HOURS"); - assertThat(ReflectionTestUtils.getField(issue, "message").toString()).contains("营业时间"); - assertThat(ReflectionTestUtils.getField(issue, "productId")).isEqualTo(100L); - assertThat(ReflectionTestUtils.getField(issue, "productTitle")).isEqualTo("夜间款"); - verifyNoInteractions(appointmentCapacityService); - } - - @Test - void checkoutPreviewReportsReservationOccupancyConflict() { - ProductDO product = product(100L, "Classic", "regular", new BigDecimal("80.00")); - product.setApproximateDuration("60"); - product.setBookableArtists("77"); - CartDO cartItem = cartItem(100L, 1); - LocalDateTime appointmentTime = LocalDateTime.now().plusDays(1) - .withHour(10) - .withMinute(0) - .withSecond(0) - .withNano(0); - LocalDateTime appointmentEndTime = appointmentTime.plusHours(1); - - when(productMapper.selectById(100L)).thenReturn(product); - when(cartMapper.selectByUserIdAndProductId(20L, 100L)).thenReturn(cartItem); - when(userMapper.selectById(77L)).thenReturn(artist(77L)); - when(bookableArtistSupport.isBookableServiceUser(any(UserDO.class))).thenReturn(true); - when(userShopBindingSupport.canUserAccessShop(20L, 9L, false, null)).thenReturn(true); - when(userShopBindingSupport.isUserAccessibleInShop(77L, 9L)).thenReturn(true); - when(shopMapper.selectById(9L)).thenReturn(shop("09:00-18:00")); - when(appointmentReservationMapper.countOverlappingActive(77L, appointmentTime, appointmentEndTime)).thenReturn(1); - when(couponService.getAvailableCoupons(20L, "regular", 80.0, 9L)).thenReturn(List.of()); - when(couponMapper.selectList(any())).thenReturn(List.of()); - - CheckoutPreviewVO preview = service.checkoutPreview(20L, order(100L, 1, 77L, appointmentTime)); - - assertThat(ReflectionTestUtils.getField(preview, "bookingAvailable")).isEqualTo(false); - List bookingIssues = (List) ReflectionTestUtils.getField(preview, "bookingIssues"); - assertThat(bookingIssues).hasSize(1); - Object issue = bookingIssues.get(0); - assertThat(ReflectionTestUtils.getField(issue, "code")).isEqualTo("EXISTING_CONFLICT"); - assertThat(ReflectionTestUtils.getField(issue, "productId")).isEqualTo(100L); - verifyNoInteractions(appointmentCapacityService); - } - - @Test - void createOrderReturnsBusinessCodeForBookingValidationBeforeLocking() { - assertThatThrownBy(() -> service.createOrder(20L, null)) - .isInstanceOfSatisfying(BusinessException.class, exception -> { - assertThat(exception.getCode()).isEqualTo(409); - assertThat(exception.getMessage()).isEqualTo("订单项不能为空"); - }); - } - - private CheckoutPreviewDTO order(Long productId, Integer quantity) { - return order(productId, quantity, 30L, LocalDateTime.now().plusDays(1) - .withHour(10) - .withMinute(0) - .withSecond(0) - .withNano(0)); - } - - private CheckoutPreviewDTO order(Long productId, Integer quantity, Long artistId, LocalDateTime appointmentTime) { - OrderItemDTO item = new OrderItemDTO(); - item.setProductId(productId); - item.setQuantity(quantity); - item.setArtistId(artistId); - item.setAppointmentTime(appointmentTime.toString()); - - CheckoutPreviewDTO dto = new CheckoutPreviewDTO(); - dto.setItems(List.of(item)); - return dto; - } - - private ProductDO product(Long id, String title, String tags, BigDecimal price) { - ProductDO product = new ProductDO(); - product.setId(id); - product.setTitle(title); - product.setTags(tags); - product.setPrice(price); - product.setShopId(9L); - product.setIsDelete(0); - return product; - } - - private ShopDO shop(String businessHours) { - ShopDO shop = new ShopDO(); - shop.setId(9L); - shop.setBusinessHours(businessHours); - shop.setIsDelete(0); - return shop; - } - - private CartDO cartItem(Long productId, Integer quantity) { - CartDO item = new CartDO(); - item.setUserId(20L); - item.setProductId(productId); - item.setQuantity(quantity); - item.setIsDelete(0); - return item; - } - - private UserDO user(String level) { - UserDO user = new UserDO(); - user.setId(20L); - user.setLevel(level); - user.setIsDelete(0); - return user; - } - - private UserDO artist(Long id) { - UserDO artist = new UserDO(); - artist.setId(id); - artist.setStatus(1); - artist.setIsDelete(0); - return artist; - } - - private CouponDO coupon(Long id, String name, Integer type, BigDecimal discountValue, BigDecimal minAmount, BigDecimal reduceAmount, Long shopId) { - CouponDO coupon = new CouponDO(); - coupon.setId(id); - coupon.setCouponName(name); - coupon.setCouponType(type); - coupon.setDiscountValue(discountValue); - coupon.setMinAmount(minAmount); - coupon.setReduceAmount(reduceAmount); - coupon.setShopId(shopId); - coupon.setStatus(1); - coupon.setStartTime(LocalDateTime.now().minusDays(1)); - coupon.setEndTime(LocalDateTime.now().plusDays(1)); - coupon.setIsDelete(0); - return coupon; - } - - private UserCouponVO couponOption(Long id, Long couponId, String sourceType, String name, Integer type, String discountValue, String minAmount, String reduceAmount) { - UserCouponVO coupon = new UserCouponVO(); - coupon.setId(id); - coupon.setCouponId(couponId); - coupon.setSourceType(sourceType); - coupon.setCouponName(name); - coupon.setCouponType(type); - coupon.setDiscountValue(discountValue); - coupon.setMinAmount(minAmount); - coupon.setReduceAmount(reduceAmount); - return coupon; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/OrderServiceImplReviewChangeTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/OrderServiceImplReviewChangeTest.java deleted file mode 100644 index 3429a10a..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/OrderServiceImplReviewChangeTest.java +++ /dev/null @@ -1,557 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.order.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.xiaowang.fingertipdesigner.core.modules.order.dto.OrderArtistChangeRejectDTO; -import com.xiaowang.fingertipdesigner.core.modules.order.dto.OrderArtistChangeRequestDTO; -import com.xiaowang.fingertipdesigner.core.modules.order.dto.OrderArtistReviewSubmitDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.entity.NailArtistInfoDO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderArtistChangeRequestDO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderArtistReviewDO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderDO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderItemDO; -import com.xiaowang.fingertipdesigner.core.modules.product.entity.ProductDO; -import com.xiaowang.fingertipdesigner.core.modules.message.entity.SystemMessageDO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.artist.mapper.NailArtistInfoMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderArtistChangeRequestMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderArtistReviewMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderItemMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderMapper; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.ProductMapper; -import com.xiaowang.fingertipdesigner.core.modules.message.mapper.SystemMessageMapper; -import com.xiaowang.fingertipdesigner.core.modules.user.mapper.UserMapper; -import com.xiaowang.fingertipdesigner.core.modules.planning.service.AppointmentCapacityService; -import com.xiaowang.fingertipdesigner.core.modules.integration.service.BusinessEventOutboxService; -import com.xiaowang.fingertipdesigner.core.modules.artist.support.BookableArtistSupport; -import com.xiaowang.fingertipdesigner.core.modules.file.support.ObjectStorageUrlSupport; -import com.xiaowang.fingertipdesigner.core.modules.shop.support.UserShopBindingSupport; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.dao.DuplicateKeyException; -import org.springframework.test.util.ReflectionTestUtils; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.inOrder; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class OrderServiceImplReviewChangeTest { - - @Mock - private OrderMapper orderMapper; - @Mock - private OrderItemMapper orderItemMapper; - @Mock - private OrderArtistReviewMapper orderArtistReviewMapper; - @Mock - private OrderArtistChangeRequestMapper orderArtistChangeRequestMapper; - @Mock - private ProductMapper productMapper; - @Mock - private UserMapper userMapper; - @Mock - private SystemMessageMapper systemMessageMapper; - @Mock - private NailArtistInfoMapper nailArtistInfoMapper; - @Mock - private ObjectStorageUrlSupport objectStorageUrlSupport; - @Mock - private UserShopBindingSupport userShopBindingSupport; - @Mock - private BookableArtistSupport bookableArtistSupport; - @Mock - private BusinessEventOutboxService businessEventOutboxService; - @Mock - private AppointmentCapacityService appointmentCapacityService; - - private OrderServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new OrderServiceImpl(); - ReflectionTestUtils.setField(service, "orderMapper", orderMapper); - ReflectionTestUtils.setField(service, "orderItemMapper", orderItemMapper); - ReflectionTestUtils.setField(service, "orderArtistReviewMapper", orderArtistReviewMapper); - ReflectionTestUtils.setField(service, "orderArtistChangeRequestMapper", orderArtistChangeRequestMapper); - ReflectionTestUtils.setField(service, "productMapper", productMapper); - ReflectionTestUtils.setField(service, "userMapper", userMapper); - ReflectionTestUtils.setField(service, "systemMessageMapper", systemMessageMapper); - ReflectionTestUtils.setField(service, "nailArtistInfoMapper", nailArtistInfoMapper); - ReflectionTestUtils.setField(service, "objectStorageUrlSupport", objectStorageUrlSupport); - ReflectionTestUtils.setField(service, "userShopBindingSupport", userShopBindingSupport); - ReflectionTestUtils.setField(service, "bookableArtistSupport", bookableArtistSupport); - ReflectionTestUtils.setField(service, "businessEventOutboxService", businessEventOutboxService); - ReflectionTestUtils.setField(service, "appointmentCapacityService", appointmentCapacityService); - } - - @Test - void processOrderCompletionUpdatesStatusAndEnqueuesOutboxEvent() { - OrderDO order = pendingOrder(); - when(orderMapper.selectById(1L)).thenReturn(order); - when(orderMapper.updateStatusIfCurrent(1L, 1, 2)).thenReturn(1); - - service.processOrder(1L, 2); - - verify(orderMapper).updateStatusIfCurrent(1L, 1, 2); - verify(businessEventOutboxService).enqueueOrderCompleted(1L); - verify(orderArtistReviewMapper, never()).insert(any(OrderArtistReviewDO.class)); - verify(systemMessageMapper, never()).insert(any(SystemMessageDO.class)); - } - - @Test - void processOrderCompletionRejectsConcurrentStatusChangeBeforeSideEffects() { - OrderDO order = pendingOrder(); - when(orderMapper.selectById(1L)).thenReturn(order); - when(orderMapper.updateStatusIfCurrent(1L, 1, 2)).thenReturn(0); - - assertThatThrownBy(() -> service.processOrder(1L, 2)) - .isInstanceOf(RuntimeException.class) - .hasMessageContaining("状态已变化"); - - verify(businessEventOutboxService, never()).enqueueOrderCompleted(any()); - verify(orderArtistReviewMapper, never()).insert(any(OrderArtistReviewDO.class)); - } - - @Test - void outboxOrderCompletedCreatesPendingReviewTaskAndPopupMessageOnce() { - OrderDO order = completedOrder(); - OrderItemDO item = orderItem(); - ProductDO product = product(); - UserDO artist = artist(30L); - - when(orderItemMapper.selectByOrderId(1L)).thenReturn(List.of(item)); - when(orderArtistReviewMapper.selectByOrderItemId(10L)).thenReturn(null); - when(productMapper.selectById(20L)).thenReturn(product); - when(userMapper.selectById(30L)).thenReturn(artist); - when(orderArtistReviewMapper.insert(any(OrderArtistReviewDO.class))).thenAnswer(invocation -> { - OrderArtistReviewDO review = invocation.getArgument(0); - review.setId(1000L); - return 1; - }); - - service.createPendingArtistReviewTasksAndNotifyFromOutbox(order); - - ArgumentCaptor reviewCaptor = ArgumentCaptor.forClass(OrderArtistReviewDO.class); - verify(orderArtistReviewMapper).insert(reviewCaptor.capture()); - OrderArtistReviewDO review = reviewCaptor.getValue(); - assertThat(review.getOrderItemId()).isEqualTo(10L); - assertThat(review.getCustomerId()).isEqualTo(2L); - assertThat(review.getArtistId()).isEqualTo(30L); - assertThat(review.getStatus()).isZero(); - - ArgumentCaptor messageCaptor = ArgumentCaptor.forClass(SystemMessageDO.class); - verify(systemMessageMapper).insert(messageCaptor.capture()); - assertThat(messageCaptor.getValue().getBusinessType()).isEqualTo("ORDER_ARTIST_REVIEW"); - assertThat(messageCaptor.getValue().getTargetIds()).isEqualTo("2"); - } - - @Test - void outboxOrderCompletedDoesNotCreateDuplicateReviewTask() { - OrderDO order = completedOrder(); - OrderItemDO item = orderItem(); - OrderArtistReviewDO existingReview = new OrderArtistReviewDO(); - existingReview.setId(99L); - - when(orderItemMapper.selectByOrderId(1L)).thenReturn(List.of(item)); - when(orderArtistReviewMapper.selectByOrderItemId(10L)).thenReturn(existingReview); - - service.createPendingArtistReviewTasksAndNotifyFromOutbox(order); - - verify(orderArtistReviewMapper, never()).insert(any(OrderArtistReviewDO.class)); - verify(systemMessageMapper, never()).insert(any(SystemMessageDO.class)); - } - - @Test - void outboxOrderCompletedRecoversWhenConcurrentReviewTaskInsertWins() { - OrderDO order = completedOrder(); - OrderItemDO item = orderItem(); - OrderArtistReviewDO existingReview = new OrderArtistReviewDO(); - existingReview.setId(99L); - - when(orderItemMapper.selectByOrderId(1L)).thenReturn(List.of(item)); - when(orderArtistReviewMapper.selectByOrderItemId(10L)).thenReturn(null, existingReview); - when(orderArtistReviewMapper.insert(any(OrderArtistReviewDO.class))).thenThrow(new DuplicateKeyException("duplicate")); - - service.createPendingArtistReviewTasksAndNotifyFromOutbox(order); - - verify(orderArtistReviewMapper).insert(any(OrderArtistReviewDO.class)); - verify(orderArtistReviewMapper, never()).updateById(existingReview); - } - - @Test - void outboxOrderCompletedReusesExistingReviewReminderMessage() { - OrderDO order = completedOrder(); - OrderItemDO item = orderItem(); - ProductDO product = product(); - SystemMessageDO existingMessage = new SystemMessageDO(); - existingMessage.setId(300L); - - when(orderItemMapper.selectByOrderId(1L)).thenReturn(List.of(item)); - when(orderArtistReviewMapper.selectByOrderItemId(10L)).thenReturn(null); - when(productMapper.selectById(20L)).thenReturn(product); - when(userMapper.selectById(30L)).thenReturn(artist(30L)); - when(orderArtistReviewMapper.insert(any(OrderArtistReviewDO.class))).thenAnswer(invocation -> { - OrderArtistReviewDO review = invocation.getArgument(0); - review.setId(1000L); - return 1; - }); - when(systemMessageMapper.selectOne(any(LambdaQueryWrapper.class))).thenReturn(existingMessage); - - service.createPendingArtistReviewTasksAndNotifyFromOutbox(order); - - ArgumentCaptor reviewCaptor = ArgumentCaptor.forClass(OrderArtistReviewDO.class); - verify(orderArtistReviewMapper).insert(reviewCaptor.capture()); - verify(systemMessageMapper, never()).insert(any(SystemMessageDO.class)); - verify(orderArtistReviewMapper).updateById(reviewCaptor.getValue()); - assertThat(reviewCaptor.getValue().getReminderMessageId()).isEqualTo(300L); - } - - @Test - void outboxOrderCompletedRecoversReviewReminderWhenConcurrentInsertWins() { - OrderDO order = completedOrder(); - OrderItemDO item = orderItem(); - ProductDO product = product(); - SystemMessageDO existingMessage = new SystemMessageDO(); - existingMessage.setId(301L); - - when(orderItemMapper.selectByOrderId(1L)).thenReturn(List.of(item)); - when(orderArtistReviewMapper.selectByOrderItemId(10L)).thenReturn(null); - when(productMapper.selectById(20L)).thenReturn(product); - when(userMapper.selectById(30L)).thenReturn(artist(30L)); - when(orderArtistReviewMapper.insert(any(OrderArtistReviewDO.class))).thenAnswer(invocation -> { - OrderArtistReviewDO review = invocation.getArgument(0); - review.setId(1001L); - return 1; - }); - when(systemMessageMapper.selectOne(any(LambdaQueryWrapper.class))).thenReturn(null, existingMessage); - when(systemMessageMapper.insert(any(SystemMessageDO.class))).thenThrow(new DuplicateKeyException("duplicate")); - - service.createPendingArtistReviewTasksAndNotifyFromOutbox(order); - - ArgumentCaptor messageCaptor = ArgumentCaptor.forClass(SystemMessageDO.class); - verify(systemMessageMapper).insert(messageCaptor.capture()); - assertThat(messageCaptor.getValue().getIdempotencyKey()).isEqualTo("ORDER_ARTIST_REVIEW:1001:2"); - ArgumentCaptor reviewCaptor = ArgumentCaptor.forClass(OrderArtistReviewDO.class); - verify(orderArtistReviewMapper).updateById(reviewCaptor.capture()); - assertThat(reviewCaptor.getValue().getReminderMessageId()).isEqualTo(301L); - } - - @Test - void requestArtistChangeLocksOrderItemBeforeCheckingPendingRequest() { - OrderDO order = pendingOrder(); - OrderItemDO item = orderItem(); - ProductDO product = product(); - UserDO requester = artist(30L); - UserDO requestedArtist = artist(31L); - product.setBookableArtists("30,31"); - OrderArtistChangeRequestDTO dto = new OrderArtistChangeRequestDTO(); - dto.setOrderId(1L); - dto.setOrderItemId(10L); - dto.setRequestedArtistId(31L); - dto.setReason("临时调整"); - - when(userMapper.selectById(30L)).thenReturn(requester); - when(userMapper.selectById(31L)).thenReturn(requestedArtist); - when(orderMapper.selectById(1L)).thenReturn(order); - when(orderItemMapper.selectByIdForUpdate(10L)).thenReturn(item); - when(productMapper.selectById(20L)).thenReturn(product); - when(userShopBindingSupport.isUserAccessibleInShop(30L, 3L)).thenReturn(true); - when(userShopBindingSupport.isUserAccessibleInShop(31L, 3L)).thenReturn(true); - when(bookableArtistSupport.isBookableServiceUser(requestedArtist)).thenReturn(true); - when(bookableArtistSupport.isValidBookableArtist(3L, 31L)).thenReturn(true); - - service.requestArtistChange(30L, dto); - - ArgumentCaptor requestCaptor = ArgumentCaptor.forClass(OrderArtistChangeRequestDO.class); - verify(orderArtistChangeRequestMapper).insert(requestCaptor.capture()); - assertThat(requestCaptor.getValue().getPendingKey()).isEqualTo("ORDER_ITEM:10"); - inOrder(orderItemMapper, orderArtistChangeRequestMapper).verify(orderItemMapper).selectByIdForUpdate(10L); - inOrder(orderItemMapper, orderArtistChangeRequestMapper).verify(orderArtistChangeRequestMapper).selectPendingByOrderItemId(10L); - verify(orderItemMapper, never()).selectById(10L); - } - - @Test - void approveArtistChangeRejectsAlreadyProcessedRequest() { - OrderArtistChangeRequestDO request = pendingChangeRequest(); - request.setStatus("APPROVED"); - when(orderArtistChangeRequestMapper.selectById(500L)).thenReturn(request); - - assertThatThrownBy(() -> service.approveArtistChange(500L, 2L, 0)) - .isInstanceOf(RuntimeException.class) - .hasMessage("改派申请已处理"); - - verify(orderItemMapper, never()).selectByIdForUpdate(any()); - } - - @Test - void approveArtistChangeUsesPendingConditionalUpdateBeforeAssigningArtist() { - OrderArtistChangeRequestDO request = pendingChangeRequest(); - OrderDO order = pendingOrder(); - OrderItemDO item = orderItem(); - ProductDO product = product(); - UserDO newArtist = artist(31L); - product.setBookableArtists("30,31"); - - when(orderArtistChangeRequestMapper.selectById(500L)).thenReturn(request); - when(orderMapper.selectById(1L)).thenReturn(order); - when(orderItemMapper.selectByIdForUpdate(10L)).thenReturn(item); - when(productMapper.selectById(20L)).thenReturn(product); - when(userMapper.selectById(31L)).thenReturn(newArtist); - when(userShopBindingSupport.isUserAccessibleInShop(31L, 3L)).thenReturn(true); - when(bookableArtistSupport.isBookableServiceUser(newArtist)).thenReturn(true); - when(bookableArtistSupport.isValidBookableArtist(3L, 31L)).thenReturn(true); - when(orderArtistChangeRequestMapper.approvePending(eq(500L), any(LocalDateTime.class))).thenReturn(1); - - service.approveArtistChange(500L, 2L, 0); - - inOrder(orderArtistChangeRequestMapper, orderItemMapper) - .verify(orderArtistChangeRequestMapper).approvePending(eq(500L), any(LocalDateTime.class)); - inOrder(orderArtistChangeRequestMapper, orderItemMapper).verify(orderItemMapper).updateById(item); - assertThat(item.getArtistId()).isEqualTo(31L); - verify(orderArtistChangeRequestMapper, never()).updateById(any(OrderArtistChangeRequestDO.class)); - } - - @Test - void approveArtistChangeRejectsConcurrentProcessedRequestBeforeAssigningArtist() { - OrderArtistChangeRequestDO request = pendingChangeRequest(); - OrderDO order = pendingOrder(); - OrderItemDO item = orderItem(); - ProductDO product = product(); - UserDO newArtist = artist(31L); - product.setBookableArtists("30,31"); - - when(orderArtistChangeRequestMapper.selectById(500L)).thenReturn(request); - when(orderMapper.selectById(1L)).thenReturn(order); - when(orderItemMapper.selectByIdForUpdate(10L)).thenReturn(item); - when(productMapper.selectById(20L)).thenReturn(product); - when(userMapper.selectById(31L)).thenReturn(newArtist); - when(userShopBindingSupport.isUserAccessibleInShop(31L, 3L)).thenReturn(true); - when(bookableArtistSupport.isBookableServiceUser(newArtist)).thenReturn(true); - when(bookableArtistSupport.isValidBookableArtist(3L, 31L)).thenReturn(true); - when(orderArtistChangeRequestMapper.approvePending(eq(500L), any(LocalDateTime.class))).thenReturn(0); - - assertThatThrownBy(() -> service.approveArtistChange(500L, 2L, 0)) - .isInstanceOf(RuntimeException.class) - .hasMessage("改派申请已处理"); - - verify(orderItemMapper, never()).updateById(any(OrderItemDO.class)); - } - - @Test - void approveArtistChangeExpiresPendingRequestBeforeProcessing() { - OrderArtistChangeRequestDO request = pendingChangeRequest(); - request.setExpireTime(LocalDateTime.now().minusMinutes(1)); - when(orderArtistChangeRequestMapper.selectById(500L)).thenReturn(request); - - assertThatThrownBy(() -> service.approveArtistChange(500L, 2L, 0)) - .isInstanceOf(RuntimeException.class) - .hasMessageContaining("过期"); - - verify(orderArtistChangeRequestMapper).expirePendingById(eq(500L), any(LocalDateTime.class)); - verify(orderItemMapper, never()).selectByIdForUpdate(any()); - verify(orderItemMapper, never()).updateById(any(OrderItemDO.class)); - } - - @Test - void rejectArtistChangeUsesPendingConditionalUpdate() { - OrderArtistChangeRequestDO request = pendingChangeRequest(); - when(orderArtistChangeRequestMapper.selectById(500L)).thenReturn(request); - when(orderArtistChangeRequestMapper.rejectPending(eq(500L), eq("客户不方便"), any(LocalDateTime.class))).thenReturn(1); - - OrderArtistChangeRejectDTO dto = new OrderArtistChangeRejectDTO(); - dto.setRejectReason("客户不方便"); - - service.rejectArtistChange(500L, 2L, 0, dto); - - verify(orderArtistChangeRequestMapper).rejectPending(eq(500L), eq("客户不方便"), any(LocalDateTime.class)); - verify(orderArtistChangeRequestMapper, never()).updateById(any(OrderArtistChangeRequestDO.class)); - } - - @Test - void rejectArtistChangeRejectsConcurrentProcessedRequest() { - OrderArtistChangeRequestDO request = pendingChangeRequest(); - when(orderArtistChangeRequestMapper.selectById(500L)).thenReturn(request); - when(orderArtistChangeRequestMapper.rejectPending(eq(500L), eq("客户不方便"), any(LocalDateTime.class))).thenReturn(0); - - OrderArtistChangeRejectDTO dto = new OrderArtistChangeRejectDTO(); - dto.setRejectReason("客户不方便"); - - assertThatThrownBy(() -> service.rejectArtistChange(500L, 2L, 0, dto)) - .isInstanceOf(RuntimeException.class) - .hasMessage("改派申请已处理"); - - verify(orderArtistChangeRequestMapper, never()).updateById(any(OrderArtistChangeRequestDO.class)); - } - - @Test - void listMyPendingArtistChangeRequestsExpiresDueRequestsFirst() { - when(orderArtistChangeRequestMapper.selectPendingByUserId(2L)).thenReturn(List.of()); - - assertThat(service.listMyPendingArtistChangeRequests(2L, 0)).isEmpty(); - - verify(orderArtistChangeRequestMapper).expirePendingBefore(any(LocalDateTime.class)); - verify(orderArtistChangeRequestMapper).selectPendingByUserId(2L); - } - - @Test - void listOrderArtistChangeRequestsExpiresDueRequestsAndReturnsHistoryForAccessibleOrder() { - OrderDO order = pendingOrder(); - OrderArtistChangeRequestDO approved = pendingChangeRequest(); - approved.setStatus("APPROVED"); - approved.setApprovedTime(LocalDateTime.now().minusHours(2)); - OrderArtistChangeRequestDO rejected = pendingChangeRequest(); - rejected.setId(501L); - rejected.setStatus("REJECTED"); - rejected.setRejectedTime(LocalDateTime.now().minusHours(1)); - rejected.setRejectReason("时间不合适"); - - when(orderMapper.selectById(1L)).thenReturn(order); - when(orderArtistChangeRequestMapper.selectByOrderId(1L)).thenReturn(List.of(approved, rejected)); - when(productMapper.selectById(20L)).thenReturn(product()); - when(userMapper.selectById(30L)).thenReturn(artist(30L)); - when(userMapper.selectById(31L)).thenReturn(artist(31L)); - - assertThat(service.listOrderArtistChangeRequests(1L, 2L, 0)) - .extracting("id") - .containsExactly(500L, 501L); - - verify(orderArtistChangeRequestMapper).expirePendingBefore(any(LocalDateTime.class)); - verify(orderArtistChangeRequestMapper).selectByOrderId(1L); - } - - @Test - void listOrderArtistChangeRequestsRejectsInaccessibleOrder() { - OrderDO order = pendingOrder(); - when(orderMapper.selectById(1L)).thenReturn(order); - when(orderItemMapper.selectByOrderId(1L)).thenReturn(List.of(orderItem())); - - assertThatThrownBy(() -> service.listOrderArtistChangeRequests(1L, 99L, 0)) - .isInstanceOf(RuntimeException.class) - .hasMessageContaining("ORDER_ARTIST_CHANGE_FORBIDDEN"); - - verify(orderArtistChangeRequestMapper).expirePendingBefore(any(LocalDateTime.class)); - verify(orderArtistChangeRequestMapper, never()).selectByOrderId(any()); - } - - @Test - void submitArtistReviewRequiresHalfPointRating() { - OrderArtistReviewDO review = pendingReview(); - when(orderArtistReviewMapper.selectById(100L)).thenReturn(review); - - OrderArtistReviewSubmitDTO dto = new OrderArtistReviewSubmitDTO(); - dto.setRating(new BigDecimal("4.25")); - - assertThatThrownBy(() -> service.submitArtistReview(100L, 2L, dto)) - .isInstanceOf(RuntimeException.class) - .hasMessage("评分必须按0.5分递增"); - - verify(orderArtistReviewMapper, never()).updateById(any(OrderArtistReviewDO.class)); - } - - @Test - void submitArtistReviewAcceptsValidRatingAndRefreshesArtistRating() { - OrderArtistReviewDO review = pendingReview(); - NailArtistInfoDO artistInfo = new NailArtistInfoDO(); - artistInfo.setId(200L); - when(orderArtistReviewMapper.selectById(100L)).thenReturn(review); - when(orderArtistReviewMapper.selectAverageSubmittedRatingByArtistId(30L)).thenReturn(new BigDecimal("4.75")); - when(nailArtistInfoMapper.selectOne(any(LambdaQueryWrapper.class))).thenReturn(artistInfo); - - OrderArtistReviewSubmitDTO dto = new OrderArtistReviewSubmitDTO(); - dto.setRating(new BigDecimal("4.5")); - dto.setContent("服务很细致"); - - assertThat(service.submitArtistReview(100L, 2L, dto).getRatingScore()).isEqualByComparingTo("4.5"); - - verify(orderArtistReviewMapper).updateById(review); - verify(nailArtistInfoMapper).updateById(artistInfo); - assertThat(artistInfo.getRating()).isEqualByComparingTo("4.8"); - } - - private OrderDO pendingOrder() { - OrderDO order = new OrderDO(); - order.setId(1L); - order.setUserId(2L); - order.setShopId(3L); - order.setStatus(1); - order.setIsDelete(0); - return order; - } - - private OrderDO completedOrder() { - OrderDO order = pendingOrder(); - order.setStatus(2); - return order; - } - - private OrderItemDO orderItem() { - OrderItemDO item = new OrderItemDO(); - item.setId(10L); - item.setOrderId(1L); - item.setProductId(20L); - item.setArtistId(30L); - item.setQuantity(1); - item.setIsDelete(0); - return item; - } - - private ProductDO product() { - ProductDO product = new ProductDO(); - product.setId(20L); - product.setTitle("凝胶美甲"); - product.setIsDelete(0); - return product; - } - - private UserDO artist(Long id) { - UserDO artist = new UserDO(); - artist.setId(id); - artist.setType(3); - artist.setStatus(1); - artist.setIsDelete(0); - artist.setNickname("美甲师" + id); - return artist; - } - - private OrderArtistReviewDO pendingReview() { - OrderArtistReviewDO review = new OrderArtistReviewDO(); - review.setId(100L); - review.setOrderId(1L); - review.setOrderItemId(10L); - review.setProductId(20L); - review.setCustomerId(2L); - review.setArtistId(30L); - review.setStatus(0); - review.setIsDelete(0); - return review; - } - - private OrderArtistChangeRequestDO pendingChangeRequest() { - OrderArtistChangeRequestDO request = new OrderArtistChangeRequestDO(); - request.setId(500L); - request.setOrderId(1L); - request.setOrderItemId(10L); - request.setProductId(20L); - request.setShopId(3L); - request.setCustomerId(2L); - request.setFromArtistId(30L); - request.setToArtistId(31L); - request.setRequesterId(30L); - request.setStatus("PENDING"); - request.setExpireTime(LocalDateTime.now().plusDays(1)); - request.setIsDelete(0); - return request; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/support/OrderStateMachineTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/support/OrderStateMachineTest.java deleted file mode 100644 index db952cb9..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/order/support/OrderStateMachineTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.order.support; - -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - -class OrderStateMachineTest { - - @Test - void allowsPriceConfirmingOrderToBecomePendingServiceOrCancelled() { - assertThat(OrderStateMachine.isAllowedTransition(0, 1)).isTrue(); - assertThat(OrderStateMachine.isAllowedTransition(0, 3)).isTrue(); - assertThat(OrderStateMachine.isAllowedTransition(0, 2)).isFalse(); - } - - @Test - void allowsPendingOrderToCompleteOrCancel() { - assertThat(OrderStateMachine.isAllowedTransition(1, 2)).isTrue(); - assertThat(OrderStateMachine.isAllowedTransition(1, 3)).isTrue(); - } - - @Test - void rejectsInvalidOrderTransition() { - assertThat(OrderStateMachine.isAllowedTransition(2, 3)).isFalse(); - assertThatThrownBy(() -> OrderStateMachine.requireAllowedTransition(2, 3)) - .isInstanceOf(RuntimeException.class) - .hasMessage("订单状态不允许处理"); - } - - @Test - void rejectsUnknownTargetStatus() { - assertThatThrownBy(() -> OrderStatus.requireKnown(9)) - .isInstanceOf(RuntimeException.class) - .hasMessage("无效的订单状态"); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/PaymentServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/PaymentServiceImplTest.java deleted file mode 100644 index 7fbe2a9e..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/PaymentServiceImplTest.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.payment.service.impl; - -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderDO; -import com.xiaowang.fingertipdesigner.core.modules.payment.entity.PaymentOrderDO; -import com.xiaowang.fingertipdesigner.core.modules.payment.entity.RefundOrderDO; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderMapper; -import com.xiaowang.fingertipdesigner.core.modules.payment.mapper.PaymentOrderMapper; -import com.xiaowang.fingertipdesigner.core.modules.payment.mapper.RefundOrderMapper; -import com.xiaowang.fingertipdesigner.core.modules.payment.vo.PaymentOrderVO; -import com.xiaowang.fingertipdesigner.core.modules.payment.vo.RefundOrderVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - -import java.math.BigDecimal; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import com.xiaowang.fingertipdesigner.core.common.Result; -class PaymentServiceImplTest { - - @Mock - private OrderMapper orderMapper; - @Mock - private PaymentOrderMapper paymentOrderMapper; - @Mock - private RefundOrderMapper refundOrderMapper; - - private PaymentServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new PaymentServiceImpl(orderMapper, paymentOrderMapper, refundOrderMapper); - } - - @Test - void prepareOrderPaymentCreatesManualPaymentOrderForUnpaidOrder() { - OrderDO order = order(); - when(orderMapper.selectById(1L)).thenReturn(order); - when(paymentOrderMapper.selectLatestByOrderId(1L)).thenReturn(null); - when(paymentOrderMapper.insert(any(PaymentOrderDO.class))).thenAnswer(invocation -> { - PaymentOrderDO payment = invocation.getArgument(0); - payment.setId(100L); - return 1; - }); - - PaymentOrderVO result = service.prepareOrderPayment(2L, 1L); - - assertThat(result.getOrderId()).isEqualTo(1L); - assertThat(result.getStatus()).isEqualTo("PAYING"); - assertThat(result.getPayAmount()).isEqualByComparingTo("88.00"); - ArgumentCaptor captor = ArgumentCaptor.forClass(PaymentOrderDO.class); - verify(paymentOrderMapper).insert(captor.capture()); - assertThat(captor.getValue().getChannel()).isEqualTo("MANUAL"); - } - - @Test - void manualConfirmOrderPaidUpdatesPaymentAndOrderSnapshot() { - OrderDO order = order(); - PaymentOrderDO payment = new PaymentOrderDO(); - payment.setId(100L); - payment.setOrderId(1L); - payment.setStatus("PAYING"); - payment.setPayAmount(new BigDecimal("88.00")); - when(orderMapper.selectById(1L)).thenReturn(order); - when(paymentOrderMapper.selectLatestByOrderId(1L)).thenReturn(payment); - - PaymentOrderVO result = service.manualConfirmOrderPaid(900L, 1L, "cash"); - - assertThat(result.getStatus()).isEqualTo("PAID"); - verify(paymentOrderMapper).updateById(payment); - verify(orderMapper).updateById(order); - assertThat(order.getPaymentStatus()).isEqualTo("PAID"); - assertThat(order.getPaidAmount()).isEqualByComparingTo("88.00"); - } - - @Test - void manualRefundOrderCreatesRefundAndUpdatesOrderSnapshot() { - OrderDO order = order(); - order.setPaymentStatus("PAID"); - PaymentOrderDO payment = new PaymentOrderDO(); - payment.setId(100L); - payment.setOrderId(1L); - payment.setStatus("PAID"); - payment.setPayAmount(new BigDecimal("88.00")); - payment.setPaidAmount(new BigDecimal("88.00")); - payment.setChannel("MANUAL"); - when(orderMapper.selectById(1L)).thenReturn(order); - when(paymentOrderMapper.selectLatestByOrderId(1L)).thenReturn(payment); - when(refundOrderMapper.insert(any(RefundOrderDO.class))).thenAnswer(invocation -> { - RefundOrderDO refund = invocation.getArgument(0); - refund.setId(200L); - return 1; - }); - - RefundOrderVO result = service.manualRefundOrder(900L, 1L, 300L, "manual"); - - assertThat(result.getStatus()).isEqualTo("REFUNDED"); - assertThat(result.getRefundAmount()).isEqualByComparingTo("88.00"); - verify(refundOrderMapper).insert(any(RefundOrderDO.class)); - verify(orderMapper).updateById(order); - assertThat(order.getPaymentStatus()).isEqualTo("REFUNDED"); - assertThat(order.getRefundStatus()).isEqualTo("REFUNDED"); - } - - private OrderDO order() { - OrderDO order = new OrderDO(); - order.setId(1L); - order.setOrderNo("ORD1"); - order.setUserId(2L); - order.setShopId(9L); - order.setActualAmount(new BigDecimal("88.00")); - order.setStatus(1); - order.setIsDelete(0); - order.setPaymentStatus("UNPAID"); - return order; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/AppointmentCapacityServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/AppointmentCapacityServiceImplTest.java deleted file mode 100644 index 1e9add36..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/AppointmentCapacityServiceImplTest.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.planning.service.impl; - -import com.xiaowang.fingertipdesigner.core.modules.planning.entity.AppointmentReservationDO; -import com.xiaowang.fingertipdesigner.core.modules.artist.entity.ArtistScheduleDO; -import com.xiaowang.fingertipdesigner.core.modules.planning.mapper.AppointmentReservationMapper; -import com.xiaowang.fingertipdesigner.core.modules.artist.mapper.ArtistScheduleMapper; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.when; - -class AppointmentCapacityServiceImplTest { - - @Mock - private AppointmentReservationMapper reservationMapper; - @Mock - private ArtistScheduleMapper scheduleMapper; - - private AppointmentCapacityServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new AppointmentCapacityServiceImpl(reservationMapper, scheduleMapper); - } - - @Test - void reserveRejectsWhenConfiguredCapacityIsFull() { - LocalDateTime start = LocalDateTime.of(2026, 6, 1, 10, 0); - LocalDateTime end = start.plusHours(1); - when(scheduleMapper.selectCoveringSchedule(9L, 30L, start.toLocalDate(), start.toLocalTime(), end.toLocalTime())) - .thenReturn(schedule(2)); - when(reservationMapper.countOverlappingActiveForUpdate(30L, start, end)).thenReturn(2); - - assertThatThrownBy(() -> service.reserveOrThrow(1L, 10L, 9L, 30L, "French", start, end)) - .isInstanceOf(RuntimeException.class); - } - - @Test - void reserveCreatesConfirmedReservationWhenCapacityRemains() { - LocalDateTime start = LocalDateTime.of(2026, 6, 1, 10, 0); - LocalDateTime end = start.plusHours(1); - when(scheduleMapper.selectCoveringSchedule(9L, 30L, start.toLocalDate(), start.toLocalTime(), end.toLocalTime())) - .thenReturn(schedule(2)); - when(reservationMapper.countOverlappingActiveForUpdate(30L, start, end)).thenReturn(1); - - service.reserveOrThrow(1L, 10L, 9L, 30L, "French", start, end); - - ArgumentCaptor captor = ArgumentCaptor.forClass(AppointmentReservationDO.class); - verify(reservationMapper).insert(captor.capture()); - AppointmentReservationDO reservation = captor.getValue(); - assertThat(reservation.getOrderId()).isEqualTo(1L); - assertThat(reservation.getOrderItemId()).isEqualTo(10L); - assertThat(reservation.getArtistId()).isEqualTo(30L); - assertThat(reservation.getStatus()).isEqualTo("CONFIRMED"); - } - - @Test - void reservePendingQuoteCreatesPendingReservationWithClientRequestId() { - LocalDateTime start = LocalDateTime.of(2026, 6, 1, 10, 0); - LocalDateTime end = start.plusHours(1); - when(scheduleMapper.selectCoveringSchedule(9L, 30L, start.toLocalDate(), start.toLocalTime(), end.toLocalTime())) - .thenReturn(schedule(2)); - when(reservationMapper.countOverlappingActiveForUpdate(30L, start, end)).thenReturn(0); - - service.reservePendingQuoteOrThrow(1L, 10L, 9L, 30L, "French", start, end, "req-1"); - - ArgumentCaptor captor = ArgumentCaptor.forClass(AppointmentReservationDO.class); - verify(reservationMapper).insert(captor.capture()); - AppointmentReservationDO reservation = captor.getValue(); - assertThat(reservation.getStatus()).isEqualTo("PENDING_QUOTE"); - assertThat(reservation.getClientRequestId()).isEqualTo("req-1"); - } - - @Test - void confirmReservationUpgradesExistingPendingReservationWithoutSelfConflict() { - LocalDateTime start = LocalDateTime.of(2026, 6, 1, 10, 0); - LocalDateTime end = start.plusHours(1); - when(scheduleMapper.selectCoveringSchedule(9L, 30L, start.toLocalDate(), start.toLocalTime(), end.toLocalTime())) - .thenReturn(schedule(2)); - when(reservationMapper.countOverlappingActiveForUpdateExcludingOrderItem(30L, 10L, start, end)).thenReturn(0); - when(reservationMapper.updateActiveReservationForOrderItemWithClientRequest(10L, 1L, 9L, 30L, "French", start, end, "CONFIRMED", null)) - .thenReturn(1); - - service.confirmReservationOrThrow(1L, 10L, 9L, 30L, "French", start, end); - - verify(reservationMapper).updateActiveReservationForOrderItemWithClientRequest(10L, 1L, 9L, 30L, "French", start, end, "CONFIRMED", null); - verify(reservationMapper, never()).insert(org.mockito.ArgumentMatchers.any(AppointmentReservationDO.class)); - } - - @Test - void reserveRejectsWhenNoCoveringScheduleExists() { - LocalDateTime start = LocalDateTime.of(2026, 6, 2, 10, 0); - LocalDateTime end = start.plusHours(1); - when(scheduleMapper.selectCoveringSchedule(9L, 30L, start.toLocalDate(), start.toLocalTime(), end.toLocalTime())) - .thenReturn(null); - - assertThatThrownBy(() -> service.reserveOrThrow(1L, 10L, 9L, 30L, "French", start, end)) - .isInstanceOf(RuntimeException.class) - .hasMessageContaining("涓嶅彲棰勭害"); - - verify(reservationMapper, never()).insert(org.mockito.ArgumentMatchers.any(AppointmentReservationDO.class)); - } - - @Test - void reserveRejectsWhenCoveringScheduleIsDisabled() { - LocalDateTime start = LocalDateTime.of(2026, 6, 1, 10, 0); - LocalDateTime end = start.plusHours(1); - ArtistScheduleDO disabled = schedule(1); - disabled.setStatus(0); - when(scheduleMapper.selectCoveringSchedule(9L, 30L, start.toLocalDate(), start.toLocalTime(), end.toLocalTime())) - .thenReturn(disabled); - - assertThatThrownBy(() -> service.reserveOrThrow(1L, 10L, 9L, 30L, "French", start, end)) - .isInstanceOf(RuntimeException.class) - .hasMessageContaining("涓嶅彲棰勭害"); - - verify(reservationMapper, never()).insert(org.mockito.ArgumentMatchers.any(AppointmentReservationDO.class)); - } - - @Test - void reserveRejectsWhenCoveringScheduleHasZeroCapacity() { - LocalDateTime start = LocalDateTime.of(2026, 6, 1, 10, 0); - LocalDateTime end = start.plusHours(1); - when(scheduleMapper.selectCoveringSchedule(9L, 30L, start.toLocalDate(), start.toLocalTime(), end.toLocalTime())) - .thenReturn(schedule(0)); - - assertThatThrownBy(() -> service.reserveOrThrow(1L, 10L, 9L, 30L, "French", start, end)) - .isInstanceOf(RuntimeException.class) - .hasMessageContaining("涓嶅彲棰勭害"); - - verify(reservationMapper, never()).insert(org.mockito.ArgumentMatchers.any(AppointmentReservationDO.class)); - } - - @Test - void moveReservationRechecksNewArtistCapacityBeforeUpdatingArtist() { - LocalDateTime start = LocalDateTime.of(2026, 6, 1, 10, 0); - LocalDateTime end = start.plusHours(1); - when(scheduleMapper.selectCoveringSchedule(9L, 31L, start.toLocalDate(), start.toLocalTime(), end.toLocalTime())) - .thenReturn(schedule(1)); - when(reservationMapper.countOverlappingActiveForUpdateExcludingOrderItem(31L, 10L, start, end)).thenReturn(0); - when(reservationMapper.updateActiveReservationForOrderItem(10L, 1L, 9L, 31L, "French", start, end, "CONFIRMED")) - .thenReturn(1); - - service.moveReservationForArtistChange(1L, 10L, 9L, 30L, 31L, "French", start, end); - - verify(reservationMapper).updateActiveReservationForOrderItem(10L, 1L, 9L, 31L, "French", start, end, "CONFIRMED"); - verify(reservationMapper, never()).releaseByOrderItem(10L, "RELEASED"); - verify(reservationMapper, never()).insert(org.mockito.ArgumentMatchers.any(AppointmentReservationDO.class)); - } - - private ArtistScheduleDO schedule(int capacity) { - ArtistScheduleDO schedule = new ArtistScheduleDO(); - schedule.setShopId(9L); - schedule.setArtistId(30L); - schedule.setWorkDate(LocalDate.of(2026, 6, 1)); - schedule.setStartTime(LocalTime.of(10, 0)); - schedule.setEndTime(LocalTime.of(20, 0)); - schedule.setCapacity(capacity); - schedule.setStatus(1); - schedule.setIsDelete(0); - return schedule; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/PlanningServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/PlanningServiceImplTest.java deleted file mode 100644 index 75c2420a..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/PlanningServiceImplTest.java +++ /dev/null @@ -1,305 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.planning.service.impl; - -import com.xiaowang.fingertipdesigner.core.modules.artist.mapper.ArtistScheduleMapper; -import com.xiaowang.fingertipdesigner.core.modules.artist.mapper.NailArtistInfoMapper; -import com.xiaowang.fingertipdesigner.core.modules.artist.entity.ArtistScheduleDO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderDO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderItemDO; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderItemMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.service.OrderService; -import com.xiaowang.fingertipdesigner.core.modules.planning.dto.PlanningAppointmentCreateDTO; -import com.xiaowang.fingertipdesigner.core.modules.planning.entity.AppointmentReservationDO; -import com.xiaowang.fingertipdesigner.core.modules.planning.mapper.AppointmentReservationMapper; -import com.xiaowang.fingertipdesigner.core.modules.planning.service.AppointmentCapacityService; -import com.xiaowang.fingertipdesigner.core.modules.product.entity.ProductDO; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.ProductMapper; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.shop.entity.ShopDO; -import com.xiaowang.fingertipdesigner.core.modules.shop.mapper.ShopMapper; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.user.mapper.UserMapper; -import com.xiaowang.fingertipdesigner.core.support.id.TimeOrderedSnowflakeIdGenerator; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class PlanningServiceImplTest { - - @Mock - private AdminScopeHelper adminScopeHelper; - - @Mock - private UserMapper userMapper; - - @Mock - private NailArtistInfoMapper nailArtistInfoMapper; - - @Mock - private ArtistScheduleMapper artistScheduleMapper; - - @Mock - private AppointmentReservationMapper appointmentReservationMapper; - - @Mock - private OrderMapper orderMapper; - - @Mock - private OrderItemMapper orderItemMapper; - - @Mock - private ProductMapper productMapper; - - @Mock - private ShopMapper shopMapper; - - @Mock - private AppointmentCapacityService appointmentCapacityService; - - @Mock - private OrderService orderService; - - @Mock - private TimeOrderedSnowflakeIdGenerator snowflakeIdGenerator; - - private PlanningServiceImpl planningService; - - @BeforeEach - void setUp() { - planningService = new PlanningServiceImpl( - adminScopeHelper, - userMapper, - nailArtistInfoMapper, - artistScheduleMapper, - appointmentReservationMapper, - orderMapper, - orderItemMapper, - productMapper, - shopMapper, - appointmentCapacityService, - orderService, - snowflakeIdGenerator - ); - } - - @Test - void createAppointmentShouldHideManualProductFromFront() { - UserDO manager = user(2, 8L); - UserDO artist = user(3, 8L); - artist.setId(20L); - UserDO customer = user(0, 8L); - customer.setId(30L); - ShopDO shop = new ShopDO(); - shop.setBusinessHours("10:00-22:00"); - PlanningAppointmentCreateDTO dto = new PlanningAppointmentCreateDTO(); - dto.setCustomerUserId(30L); - dto.setArtistId(20L); - dto.setAppointmentDate("2026-06-26"); - dto.setAppointmentTime("13:00"); - dto.setDurationMinutes(90); - dto.setManualProductTitle(" 日落贝壳 "); - dto.setManualProductPrice(new BigDecimal("168.00")); - dto.setClientRequestId("manual-product-test"); - - when(adminScopeHelper.resolveShopScope(manager, null)).thenReturn(8L); - when(productMapper.insert(any(ProductDO.class))).thenAnswer(invocation -> { - ProductDO product = invocation.getArgument(0); - product.setId(100L); - return 1; - }); - when(userMapper.selectById(20L)).thenReturn(artist); - when(userMapper.selectById(30L)).thenReturn(customer); - when(shopMapper.selectById(8L)).thenReturn(shop); - when(snowflakeIdGenerator.nextIdString()).thenReturn("202606260001"); - when(orderMapper.insert(any(OrderDO.class))).thenAnswer(invocation -> { - OrderDO order = invocation.getArgument(0); - order.setId(200L); - return 1; - }); - when(orderItemMapper.insert(any(OrderItemDO.class))).thenAnswer(invocation -> { - OrderItemDO item = invocation.getArgument(0); - item.setId(300L); - return 1; - }); - when(orderItemMapper.selectById(300L)).thenAnswer(invocation -> { - OrderItemDO item = new OrderItemDO(); - item.setId(300L); - item.setOrderId(200L); - item.setProductId(100L); - item.setArtistId(20L); - item.setQuantity(1); - item.setAppointmentTime(LocalDateTime.of(2026, 6, 26, 13, 0)); - item.setIsDelete(0); - return item; - }); - when(orderMapper.selectById(200L)).thenAnswer(invocation -> { - OrderDO order = new OrderDO(); - order.setId(200L); - order.setUserId(30L); - order.setShopId(8L); - order.setStatus(1); - order.setIsDelete(0); - return order; - }); - when(productMapper.selectById(100L)).thenAnswer(invocation -> { - ProductDO product = new ProductDO(); - product.setId(100L); - product.setShopId(8L); - product.setTitle("日落贝壳"); - product.setPrice(new BigDecimal("168.00")); - product.setApproximateDuration("90分钟"); - product.setFrontVisible(0); - product.setSourceType("MANAGER_APPOINTMENT"); - product.setIsDelete(0); - return product; - }); - AppointmentReservationDO reservation = new AppointmentReservationDO(); - reservation.setOrderItemId(300L); - reservation.setArtistId(20L); - reservation.setProductTitle("日落贝壳"); - reservation.setAppointmentStartTime(LocalDateTime.of(2026, 6, 26, 13, 0)); - reservation.setAppointmentEndTime(LocalDateTime.of(2026, 6, 26, 14, 30)); - when(appointmentReservationMapper.selectOne(any())).thenReturn(reservation); - when(userMapper.selectBatchIds(any())).thenReturn(List.of(customer)); - - planningService.createAppointment(manager, dto); - - ArgumentCaptor captor = ArgumentCaptor.forClass(ProductDO.class); - org.mockito.Mockito.verify(productMapper).insert(captor.capture()); - ProductDO product = captor.getValue(); - assertThat(product.getTitle()).isEqualTo("日落贝壳"); - assertThat(product.getFrontVisible()).isZero(); - assertThat(product.getSourceType()).isEqualTo("MANAGER_APPOINTMENT"); - assertThat(product.getImageFileIds()).isNull(); - } - - @Test - void calendarMarksMonthAvailabilityByContinuousNinetyMinuteWindow() { - UserDO manager = user(2, 8L); - UserDO freeArtist = user(3, 8L); - freeArtist.setId(20L); - freeArtist.setNickname("小王"); - UserDO shortShiftArtist = user(3, 8L); - shortShiftArtist.setId(21L); - shortShiftArtist.setNickname("小李"); - LocalDate date = LocalDate.of(2026, 6, 26); - ShopDO shop = new ShopDO(); - shop.setBusinessHours("09:00-18:00"); - ArtistScheduleDO freeSchedule = schedule(20L, date, LocalTime.of(9, 0), LocalTime.of(12, 0)); - ArtistScheduleDO shortSchedule = schedule(21L, date, LocalTime.of(9, 0), LocalTime.of(10, 0)); - AppointmentReservationDO reservation = reservation(20L, 200L, 300L, date.atTime(10, 30), date.atTime(12, 0)); - OrderDO order = order(200L, 8L, 30L); - OrderItemDO item = orderItem(300L, 200L, 100L, 20L, date.atTime(10, 30)); - ProductDO product = product(100L, 8L, "90分钟"); - UserDO customer = user(0, 8L); - customer.setId(30L); - customer.setNickname("测试客户"); - - when(adminScopeHelper.resolveShopScope(manager, null)).thenReturn(8L); - when(shopMapper.selectById(8L)).thenReturn(shop); - when(userMapper.selectList(any())).thenReturn(List.of(freeArtist, shortShiftArtist)); - when(nailArtistInfoMapper.selectList(any())).thenReturn(List.of()); - when(artistScheduleMapper.selectList(any())).thenReturn(List.of(freeSchedule, shortSchedule)); - when(appointmentReservationMapper.selectList(any())).thenReturn(List.of(reservation)); - when(orderItemMapper.selectList(any())).thenReturn(List.of()); - when(orderItemMapper.selectBatchIds(any())).thenReturn(List.of(item)); - when(orderMapper.selectBatchIds(any())).thenReturn(List.of(order)); - when(productMapper.selectBatchIds(any())).thenReturn(List.of(product)); - when(userMapper.selectBatchIds(any())).thenReturn(List.of(customer)); - - var calendar = planningService.getCalendar(manager, date, date, null); - - var summary = calendar.getDaySummaries().get(0); - assertThat(summary.getDayStatus()).isEqualTo("working"); - assertThat(summary.getArtistCounts()) - .extracting(count -> count.getArtistId() + ":" + count.getStatus()) - .contains("20:working", "21:full"); - } - - private UserDO user(Integer type, Long shopId) { - UserDO user = new UserDO(); - user.setId(10L + type); - user.setType(type); - user.setShopId(shopId); - user.setIsDelete(0); - user.setNickname("测试用户"); - user.setPhone("13800138000"); - return user; - } - - private ArtistScheduleDO schedule(Long artistId, LocalDate date, LocalTime startTime, LocalTime endTime) { - ArtistScheduleDO schedule = new ArtistScheduleDO(); - schedule.setId(1000L + artistId); - schedule.setShopId(8L); - schedule.setArtistId(artistId); - schedule.setWorkDate(date); - schedule.setStartTime(startTime); - schedule.setEndTime(endTime); - schedule.setCapacity(1); - schedule.setSlotMinutes(90); - schedule.setStatus(1); - schedule.setIsDelete(0); - return schedule; - } - - private AppointmentReservationDO reservation(Long artistId, Long orderId, Long orderItemId, - LocalDateTime startTime, LocalDateTime endTime) { - AppointmentReservationDO reservation = new AppointmentReservationDO(); - reservation.setOrderId(orderId); - reservation.setOrderItemId(orderItemId); - reservation.setShopId(8L); - reservation.setArtistId(artistId); - reservation.setProductTitle("测试预约"); - reservation.setAppointmentStartTime(startTime); - reservation.setAppointmentEndTime(endTime); - reservation.setStatus("CONFIRMED"); - reservation.setIsDelete(0); - return reservation; - } - - private OrderDO order(Long orderId, Long shopId, Long customerId) { - OrderDO order = new OrderDO(); - order.setId(orderId); - order.setShopId(shopId); - order.setUserId(customerId); - order.setStatus(1); - order.setIsDelete(0); - return order; - } - - private OrderItemDO orderItem(Long orderItemId, Long orderId, Long productId, Long artistId, LocalDateTime appointmentTime) { - OrderItemDO item = new OrderItemDO(); - item.setId(orderItemId); - item.setOrderId(orderId); - item.setProductId(productId); - item.setArtistId(artistId); - item.setQuantity(1); - item.setAppointmentTime(appointmentTime); - item.setIsDelete(0); - return item; - } - - private ProductDO product(Long productId, Long shopId, String durationText) { - ProductDO product = new ProductDO(); - product.setId(productId); - product.setShopId(shopId); - product.setTitle("测试作品"); - product.setApproximateDuration(durationText); - product.setIsDelete(0); - return product; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/planning/support/PlanningCalendarSupportTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/planning/support/PlanningCalendarSupportTest.java deleted file mode 100644 index 49d662f6..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/planning/support/PlanningCalendarSupportTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.planning.support; - -import org.junit.jupiter.api.Test; - -import java.time.LocalTime; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -class PlanningCalendarSupportTest { - - @Test - void shortNameUsesReadableSingleCharacterForDenseMonthCells() { - assertEquals("王", PlanningCalendarSupport.shortName("小王")); - assertEquals("李", PlanningCalendarSupport.shortName("李老师")); - assertEquals("A", PlanningCalendarSupport.shortName("Alice")); - } - - @Test - void businessHoursFallbackToShopManagerPlanningDefaults() { - PlanningCalendarSupport.BusinessHours hours = PlanningCalendarSupport.parseBusinessHours("10:00-22:00"); - assertEquals(LocalTime.of(10, 0), hours.start()); - assertEquals(LocalTime.of(22, 0), hours.end()); - - PlanningCalendarSupport.BusinessHours fallback = PlanningCalendarSupport.parseBusinessHours(null); - assertEquals(LocalTime.of(10, 0), fallback.start()); - assertEquals(LocalTime.of(22, 0), fallback.end()); - } - - @Test - void durationParserSupportsChineseHourAndMinuteText() { - assertEquals(90, PlanningCalendarSupport.parseDurationMinutes("1.5小时", 60)); - assertEquals(120, PlanningCalendarSupport.parseDurationMinutes("约120分钟", 60)); - assertEquals(60, PlanningCalendarSupport.parseDurationMinutes("", 60)); - } - - @Test - void dayStatusKeepsMonthViewOperationalAtAGlance() { - assertEquals("rest", PlanningCalendarSupport.resolveDayStatus(0, false, false)); - assertEquals("free", PlanningCalendarSupport.resolveDayStatus(0, true, false)); - assertEquals("working", PlanningCalendarSupport.resolveDayStatus(2, true, false)); - assertEquals("full", PlanningCalendarSupport.resolveDayStatus(6, true, true)); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/ProductControllerTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/ProductControllerTest.java deleted file mode 100644 index df9dea4f..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/ProductControllerTest.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.product.controller.front; - -import com.xiaowang.fingertipdesigner.core.modules.product.service.ProductService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.shop.support.UserShopBindingSupport; -import com.xiaowang.fingertipdesigner.core.support.security.UserSessionService; -import com.xiaowang.fingertipdesigner.core.utils.JwtUtil; -import com.xiaowang.fingertipdesigner.core.modules.product.vo.ProductVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.mock.web.MockHttpServletRequest; - -import java.util.List; - -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class ProductControllerTest { - - @Mock - private ProductService productService; - - @Mock - private AdminScopeHelper adminScopeHelper; - - @Mock - private JwtUtil jwtUtil; - - @Mock - private UserSessionService userSessionService; - - @Mock - private UserShopBindingSupport userShopBindingSupport; - - private ProductController controller; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - controller = new ProductController(productService, adminScopeHelper, jwtUtil, userSessionService, userShopBindingSupport); - } - - @Test - void listAllProductsShouldUseCurrentShopFromValidToken() { - MockHttpServletRequest request = authenticatedShopRequest(7L, 3L); - when(productService.listPublicProductsByShopId(3L)).thenReturn(List.of(new ProductVO())); - - controller.listAllProducts(request); - - verify(productService).listPublicProductsByShopId(3L); - verify(productService, never()).listPublicProducts(); - } - - @Test - void searchProductsShouldUseCurrentShopFromValidToken() { - MockHttpServletRequest request = authenticatedShopRequest(7L, 3L); - when(productService.searchProducts("猫眼", 3L)).thenReturn(List.of(new ProductVO())); - - controller.searchProducts(request, "猫眼"); - - verify(productService).searchProducts("猫眼", 3L); - verify(productService, never()).searchProducts("猫眼"); - } - - @Test - void listAllProductsShouldRemainPublicWithoutToken() { - MockHttpServletRequest request = new MockHttpServletRequest(); - when(productService.listPublicProducts()).thenReturn(List.of(new ProductVO())); - - controller.listAllProducts(request); - - verify(productService).listPublicProducts(); - verify(productService, never()).listPublicProductsByShopId(3L); - } - - @Test - void pagePublicProductsShouldPassGroupedTagIdsToService() { - MockHttpServletRequest request = new MockHttpServletRequest(); - - controller.pagePublicProducts(request, 1, 10, "", "", "11,22"); - - verify(productService).pagePublicProducts(1, 10, "", "", "11,22", null); - } - - private MockHttpServletRequest authenticatedShopRequest(Long userId, Long shopId) { - String token = "access-token"; - MockHttpServletRequest request = new MockHttpServletRequest(); - request.addHeader("Authorization", "Bearer " + token); - when(jwtUtil.validateToken(token)).thenReturn(true); - when(jwtUtil.isAccessToken(token)).thenReturn(true); - when(jwtUtil.getShopIdFromToken(token)).thenReturn(shopId); - when(jwtUtil.getUserIdFromToken(token)).thenReturn(userId); - when(jwtUtil.getSessionIdFromToken(token)).thenReturn("session-id"); - when(jwtUtil.getJtiFromToken(token)).thenReturn("jti"); - when(userSessionService.isAccessSessionActive(userId, "session-id", "jti")).thenReturn(true); - when(userShopBindingSupport.canUserAccessShop(userId, shopId, false, null)).thenReturn(true); - return request; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/ProductServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/ProductServiceImplTest.java deleted file mode 100644 index 17ae07cd..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/ProductServiceImplTest.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.product.service.impl; - -import com.xiaowang.fingertipdesigner.core.config.AppCacheProperties; -import com.xiaowang.fingertipdesigner.core.modules.product.dto.ProductDTO; -import com.xiaowang.fingertipdesigner.core.modules.product.entity.ProductDO; -import com.xiaowang.fingertipdesigner.core.modules.marketing.mapper.CouponMapper; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.ProductMapper; -import com.xiaowang.fingertipdesigner.core.modules.shop.mapper.ShopMapper; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.TagMapper; -import com.xiaowang.fingertipdesigner.core.modules.file.service.ObjectStorageFileService; -import com.xiaowang.fingertipdesigner.core.modules.file.support.ObjectStorageUrlSupport; -import com.xiaowang.fingertipdesigner.core.modules.artist.support.BookableArtistSupport; -import com.xiaowang.fingertipdesigner.core.support.cache.MultiLevelCacheService; -import com.xiaowang.fingertipdesigner.core.modules.product.vo.ProductVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.math.BigDecimal; -import java.time.Duration; - -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.when; - -import com.xiaowang.fingertipdesigner.core.modules.product.service.ProductService; -@ExtendWith(MockitoExtension.class) -class ProductServiceImplTest { - - @Mock - private ProductMapper productMapper; - - @Mock - private ObjectStorageFileService objectStorageFileService; - - @Mock - private ObjectStorageUrlSupport objectStorageUrlSupport; - - @Mock - private CouponMapper couponMapper; - - @Mock - private ShopMapper shopMapper; - - @Mock - private TagMapper tagMapper; - - @Mock - private BookableArtistSupport bookableArtistSupport; - - @Mock - private MultiLevelCacheService multiLevelCacheService; - - private ProductServiceImpl productService; - - @BeforeEach - void setUp() { - AppCacheProperties cacheProperties = new AppCacheProperties(); - productService = new ProductServiceImpl( - productMapper, - objectStorageFileService, - objectStorageUrlSupport, - couponMapper, - shopMapper, - tagMapper, - bookableArtistSupport, - multiLevelCacheService, - cacheProperties - ); - } - - @Test - void createProductShouldPersistTargetAudienceAndPrecautions() { - ProductDTO dto = new ProductDTO(); - dto.setShopId(3L); - dto.setTitle("French cat eye"); - dto.setDescription("soft shimmer"); - dto.setPrice(new BigDecimal("168.00")); - dto.setTargetAudience("Short nails, daily office style"); - dto.setPrecautions("Avoid long hot baths within 24 hours"); - when(bookableArtistSupport.filterValidBookableArtists(3L, null)).thenReturn(""); - when(productMapper.insert(any(ProductDO.class))).thenAnswer(invocation -> { - ProductDO product = invocation.getArgument(0); - product.setId(99L); - return 1; - }); - - productService.createProduct(dto); - - ArgumentCaptor captor = ArgumentCaptor.forClass(ProductDO.class); - org.mockito.Mockito.verify(productMapper).insert(captor.capture()); - assertEquals("Short nails, daily office style", captor.getValue().getTargetAudience()); - assertEquals("Avoid long hot baths within 24 hours", captor.getValue().getPrecautions()); - assertEquals(1, captor.getValue().getFrontVisible()); - assertEquals("BACKEND", captor.getValue().getSourceType()); - } - - @Test - void getProductByIdShouldExposeTargetAudienceAndPrecautions() { - ProductDO product = new ProductDO(); - product.setId(99L); - product.setShopId(3L); - product.setTitle("French cat eye"); - product.setDescription("soft shimmer"); - product.setPrice(new BigDecimal("168.00")); - product.setTargetAudience("Short nails, daily office style"); - product.setPrecautions("Avoid long hot baths within 24 hours"); - product.setIsDelete(0); - when(productMapper.selectById(99L)).thenReturn(product); - when(bookableArtistSupport.filterValidBookableArtists(3L, null)).thenReturn(""); - when(multiLevelCacheService.getOrLoad( - anyString(), - any(Duration.class), - any(Duration.class), - any(), - any() - )).thenAnswer(invocation -> ((java.util.function.Supplier) invocation.getArgument(4)).get()); - - ProductVO productVO = productService.getProductById(99L); - - assertEquals("Short nails, daily office style", productVO.getTargetAudience()); - assertEquals("Avoid long hot baths within 24 hours", productVO.getPrecautions()); - } - - @Test - void getPublicProductByIdShouldHideInvisibleProduct() { - ProductDO product = new ProductDO(); - product.setId(99L); - product.setShopId(3L); - product.setTitle("Manual appointment item"); - product.setDescription("hidden"); - product.setPrice(new BigDecimal("88.00")); - product.setFrontVisible(0); - product.setIsDelete(0); - when(productMapper.selectById(99L)).thenReturn(product); - when(multiLevelCacheService.getOrLoad( - anyString(), - any(Duration.class), - any(Duration.class), - any(), - any() - )).thenAnswer(invocation -> ((java.util.function.Supplier) invocation.getArgument(4)).get()); - - ProductVO productVO = productService.getPublicProductById(99L); - - assertNull(productVO); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/TagServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/TagServiceImplTest.java deleted file mode 100644 index 3cea3465..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/TagServiceImplTest.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.product.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.fasterxml.jackson.core.type.TypeReference; -import com.xiaowang.fingertipdesigner.core.config.AppCacheProperties; -import com.xiaowang.fingertipdesigner.core.modules.product.entity.TagDO; -import com.xiaowang.fingertipdesigner.core.modules.shop.mapper.ShopMapper; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.TagMapper; -import com.xiaowang.fingertipdesigner.core.support.cache.MultiLevelCacheService; -import com.xiaowang.fingertipdesigner.core.modules.product.vo.TagFilterGroupVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.time.Duration; -import java.util.List; -import java.util.function.Supplier; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -class TagServiceImplTest { - - private TagMapper tagMapper; - private TagServiceImpl service; - - @BeforeEach - void setUp() { - tagMapper = mock(TagMapper.class); - ShopMapper shopMapper = mock(ShopMapper.class); - MultiLevelCacheService cacheService = mock(MultiLevelCacheService.class); - AppCacheProperties cacheProperties = new AppCacheProperties(); - when(cacheService.getOrLoad( - anyString(), - any(Duration.class), - any(Duration.class), - any(TypeReference.class), - any(Supplier.class) - )).thenAnswer(invocation -> ((Supplier) invocation.getArgument(4)).get()); - service = new TagServiceImpl(tagMapper, shopMapper, cacheService, cacheProperties); - } - - @Test - void listFilterOptionsGroupsOnlyFrontVisibleTagsAndKeepsLegacyDefaults() { - TagDO style = tag(1L, "日常", "风格", "通勤", 20, 1); - TagDO legacy = tag(2L, "显白", null, null, null, null); - TagDO hidden = tag(3L, "隐藏", "风格", "隐藏", 1, 0); - when(tagMapper.selectList(any(LambdaQueryWrapper.class))).thenReturn(List.of(hidden, legacy, style)); - - List groups = service.listFilterOptions(null); - - assertThat(groups).hasSize(2); - assertThat(groups.get(0).getGroupName()).isEqualTo("风格"); - assertThat(groups.get(0).getTags()).extracting("displayName").containsExactly("通勤"); - assertThat(groups.get(1).getGroupName()).isEqualTo("其他"); - assertThat(groups.get(1).getTags()).extracting("displayName").containsExactly("显白"); - } - - private TagDO tag(Long id, String tagName, String sceneGroup, String displayName, Integer sortOrder, Integer frontVisible) { - TagDO tag = new TagDO(); - tag.setId(id); - tag.setShopId(8L); - tag.setTagName(tagName); - tag.setSceneGroup(sceneGroup); - tag.setDisplayName(displayName); - tag.setSortOrder(sortOrder); - tag.setFrontVisible(frontVisible); - tag.setIsDelete(0); - return tag; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminSecurityAuditControllerTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminSecurityAuditControllerTest.java deleted file mode 100644 index 76e25a41..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminSecurityAuditControllerTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.security.controller.admin; - -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.security.service.SecurityAuditLogService; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import com.xiaowang.fingertipdesigner.core.modules.security.vo.SecurityAuditLogVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class AdminSecurityAuditControllerTest { - - @Mock - private SecurityAuditLogService securityAuditLogService; - - private AdminSecurityAuditController controller; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - controller = new AdminSecurityAuditController(securityAuditLogService); - } - - @Test - void listLogsDelegatesToServiceWithFilters() { - PageResultVO page = new PageResultVO<>(); - page.setTotal(0L); - when(securityAuditLogService.pageLogs(eq("admin"), eq("ORDER_PROCESS"), eq("SUCCESS"), - any(), any(), eq(1), eq(20))).thenReturn(page); - - Result> result = controller.listLogs( - "admin", "ORDER_PROCESS", "SUCCESS", - "2026-05-01 00:00:00", "2026-05-23 23:59:59", 1, 20); - - assertThat(result.getData()).isSameAs(page); - verify(securityAuditLogService).pageLogs(eq("admin"), eq("ORDER_PROCESS"), eq("SUCCESS"), - any(), any(), eq(1), eq(20)); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/PermissionServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/PermissionServiceImplTest.java deleted file mode 100644 index 36a5510b..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/PermissionServiceImplTest.java +++ /dev/null @@ -1,258 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.security.service.impl; - -import com.xiaowang.fingertipdesigner.core.modules.security.entity.PermissionDO; -import com.xiaowang.fingertipdesigner.core.modules.security.entity.ShopRolePermissionDO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.security.entity.UserPermissionDO; -import com.xiaowang.fingertipdesigner.core.modules.security.entity.UserShopRoleDO; -import com.xiaowang.fingertipdesigner.core.modules.security.mapper.PermissionMapper; -import com.xiaowang.fingertipdesigner.core.modules.security.mapper.ShopRolePermissionMapper; -import com.xiaowang.fingertipdesigner.core.modules.user.mapper.UserMapper; -import com.xiaowang.fingertipdesigner.core.modules.security.mapper.UserPermissionMapper; -import com.xiaowang.fingertipdesigner.core.modules.security.mapper.UserShopRoleMapper; -import com.xiaowang.fingertipdesigner.core.support.RequestShopContext; -import com.xiaowang.fingertipdesigner.core.modules.shop.support.UserShopBindingSupport; -import com.xiaowang.fingertipdesigner.core.modules.security.vo.PermissionVO; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.verifyNoInteractions; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -class PermissionServiceImplTest { - - @Mock - private PermissionMapper permissionMapper; - - @Mock - private UserPermissionMapper userPermissionMapper; - - @Mock - private ShopRolePermissionMapper shopRolePermissionMapper; - - @Mock - private UserShopRoleMapper userShopRoleMapper; - - @Mock - private UserMapper userMapper; - - @Mock - private UserShopBindingSupport userShopBindingSupport; - - private PermissionServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new PermissionServiceImpl( - permissionMapper, - userPermissionMapper, - shopRolePermissionMapper, - userShopRoleMapper, - userMapper, - userShopBindingSupport - ); - } - - @AfterEach - void tearDown() { - RequestContextHolder.resetRequestAttributes(); - } - - @Test - void activeShopRoleRestrictsWritePermissionFromDefaultUserPermissions() { - long userId = 10L; - long productCreateId = 101L; - long productViewId = 102L; - long roleId = 201L; - - UserDO user = new UserDO(); - user.setId(userId); - user.setType(2); - user.setIsDelete(0); - when(userMapper.selectById(userId)).thenReturn(user); - - UserPermissionDO defaultProductCreate = new UserPermissionDO(); - defaultProductCreate.setUserId(userId); - defaultProductCreate.setPermissionId(productCreateId); - when(userPermissionMapper.selectList(any())).thenReturn(List.of(defaultProductCreate)); - - PermissionDO productCreate = permission(productCreateId, "product:create"); - PermissionDO productView = permission(productViewId, "product:view"); - when(permissionMapper.selectOne(any())) - .thenReturn(productCreate) - .thenReturn(productView); - - UserShopRoleDO roleBinding = new UserShopRoleDO(); - roleBinding.setUserId(userId); - roleBinding.setRoleId(roleId); - roleBinding.setStatus(1); - roleBinding.setIsDelete(0); - when(userShopRoleMapper.selectList(any())).thenReturn(List.of(roleBinding)); - - ShopRolePermissionDO rolePermission = new ShopRolePermissionDO(); - rolePermission.setRoleId(roleId); - rolePermission.setPermissionId(productViewId); - rolePermission.setIsDelete(0); - when(shopRolePermissionMapper.selectList(any())).thenReturn(List.of(rolePermission)); - - assertThat(service.hasPermission(userId, "product:create")).isFalse(); - assertThat(service.hasPermission(userId, "product:view")).isTrue(); - } - - @Test - void listUserPermissionsUsesActiveShopRoleAsVisiblePermissions() { - long userId = 10L; - long productCreateId = 101L; - long productViewId = 102L; - long roleId = 201L; - - UserDO user = new UserDO(); - user.setId(userId); - user.setType(2); - user.setIsDelete(0); - when(userMapper.selectById(userId)).thenReturn(user); - - UserPermissionDO defaultProductCreate = new UserPermissionDO(); - defaultProductCreate.setUserId(userId); - defaultProductCreate.setPermissionId(productCreateId); - when(userPermissionMapper.selectList(any())).thenReturn(List.of(defaultProductCreate)); - - UserShopRoleDO roleBinding = new UserShopRoleDO(); - roleBinding.setUserId(userId); - roleBinding.setRoleId(roleId); - roleBinding.setStatus(1); - roleBinding.setIsDelete(0); - when(userShopRoleMapper.selectList(any())).thenReturn(List.of(roleBinding)); - - ShopRolePermissionDO rolePermission = new ShopRolePermissionDO(); - rolePermission.setRoleId(roleId); - rolePermission.setPermissionId(productViewId); - rolePermission.setIsDelete(0); - when(shopRolePermissionMapper.selectList(any())).thenReturn(List.of(rolePermission)); - - when(permissionMapper.selectList(any())).thenReturn(List.of(permission(productViewId, "product:view"))); - - List permissions = service.listUserPermissions(userId); - - assertThat(permissions) - .extracting(PermissionVO::getPermissionCode) - .containsExactly("product:view"); - verify(shopRolePermissionMapper).selectList(any()); - } - - @Test - void staleDirectPermissionsCannotExceedUserTypeDefaultPermissions() { - long userId = 30L; - - UserDO user = new UserDO(); - user.setId(userId); - user.setType(3); - user.setIsDelete(0); - when(userMapper.selectById(userId)).thenReturn(user); - - assertThat(service.hasPermission(userId, "product:create")).isFalse(); - - verifyNoInteractions(userPermissionMapper); - verifyNoInteractions(userShopRoleMapper); - verifyNoInteractions(shopRolePermissionMapper); - } - - @Test - void activeShopRolesAreScopedToCurrentShop() { - long userId = 10L; - long currentShopId = 301L; - long otherShopId = 302L; - long currentShopRoleId = 401L; - long otherShopRoleId = 402L; - long productCreateId = 101L; - long productViewId = 102L; - - MockHttpServletRequest request = new MockHttpServletRequest(); - request.setAttribute(RequestShopContext.CURRENT_SHOP_ID_ATTRIBUTE, currentShopId); - RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request)); - - UserDO user = new UserDO(); - user.setId(userId); - user.setType(2); - user.setIsDelete(0); - when(userMapper.selectById(userId)).thenReturn(user); - - UserShopRoleDO currentShopRole = roleBinding(userId, currentShopId, currentShopRoleId); - UserShopRoleDO otherShopRole = roleBinding(userId, otherShopId, otherShopRoleId); - when(userShopRoleMapper.selectList(any())).thenReturn(List.of(currentShopRole, otherShopRole)); - - ShopRolePermissionDO currentShopPermission = rolePermission(currentShopRoleId, productViewId); - ShopRolePermissionDO otherShopPermission = rolePermission(otherShopRoleId, productCreateId); - when(shopRolePermissionMapper.selectList(any())).thenReturn(List.of(currentShopPermission, otherShopPermission)); - - when(permissionMapper.selectOne(any())) - .thenReturn(permission(productCreateId, "product:create")) - .thenReturn(permission(productViewId, "product:view")); - - assertThat(service.hasPermission(userId, "product:create")).isFalse(); - assertThat(service.hasPermission(userId, "product:view")).isTrue(); - } - - @Test - void shoplessPlatformAdminCurrentPermissionsIncludeSecurityAuditView() { - long userId = 1L; - UserDO user = new UserDO(); - user.setId(userId); - user.setType(4); - user.setIsDelete(0); - when(userMapper.selectById(userId)).thenReturn(user); - when(permissionMapper.selectList(any())).thenReturn(List.of( - permission(101L, "shop:view"), - permission(102L, "security:audit:view") - )); - - List permissions = service.listUserPermissions(userId); - - assertThat(permissions) - .extracting(PermissionVO::getPermissionCode) - .contains("security:audit:view"); - verifyNoInteractions(userPermissionMapper); - verifyNoInteractions(userShopRoleMapper); - verifyNoInteractions(shopRolePermissionMapper); - } - - private UserShopRoleDO roleBinding(long userId, long shopId, long roleId) { - UserShopRoleDO roleBinding = new UserShopRoleDO(); - roleBinding.setUserId(userId); - roleBinding.setShopId(shopId); - roleBinding.setRoleId(roleId); - roleBinding.setStatus(1); - roleBinding.setIsDelete(0); - return roleBinding; - } - - private ShopRolePermissionDO rolePermission(long roleId, long permissionId) { - ShopRolePermissionDO rolePermission = new ShopRolePermissionDO(); - rolePermission.setRoleId(roleId); - rolePermission.setPermissionId(permissionId); - rolePermission.setIsDelete(0); - return rolePermission; - } - - private PermissionDO permission(long id, String code) { - PermissionDO permission = new PermissionDO(); - permission.setId(id); - permission.setPermissionCode(code); - permission.setPermissionName(code); - permission.setPermissionGroup("test"); - permission.setIsDelete(0); - return permission; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/SecurityAuditLogServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/SecurityAuditLogServiceImplTest.java deleted file mode 100644 index 794751f5..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/SecurityAuditLogServiceImplTest.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.security.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.xiaowang.fingertipdesigner.core.modules.security.entity.SecurityAuditLogDO; -import com.xiaowang.fingertipdesigner.core.modules.security.mapper.SecurityAuditLogMapper; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import com.xiaowang.fingertipdesigner.core.modules.security.vo.SecurityAuditLogVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.mock.web.MockHttpServletRequest; - -import java.time.LocalDateTime; -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import com.xiaowang.fingertipdesigner.core.common.Result; -class SecurityAuditLogServiceImplTest { - - @Mock - private SecurityAuditLogMapper auditLogMapper; - - private SecurityAuditLogServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new SecurityAuditLogServiceImpl(auditLogMapper); - } - - @Test - void recordTruncatesOversizedFieldsAndCapturesForwardedIp() { - MockHttpServletRequest request = new MockHttpServletRequest(); - request.addHeader("X-Forwarded-For", "10.0.0.1, 10.0.0.2"); - - service.record(1L, "a".repeat(100), "b".repeat(100), "SUCCESS", "c".repeat(600), request); - - ArgumentCaptor captor = ArgumentCaptor.forClass(SecurityAuditLogDO.class); - verify(auditLogMapper).insert(captor.capture()); - SecurityAuditLogDO log = captor.getValue(); - assertThat(log.getAccount()).hasSize(80); - assertThat(log.getAction()).hasSize(80); - assertThat(log.getReason()).hasSize(500); - assertThat(log.getIpAddress()).isEqualTo("10.0.0.1"); - } - - @Test - @SuppressWarnings("unchecked") - void pageLogsFiltersAndMapsPagedResult() { - SecurityAuditLogDO log = new SecurityAuditLogDO(); - log.setId(100L); - log.setUserId(1L); - log.setAccount("admin"); - log.setAction("ORDER_PROCESS"); - log.setResult("SUCCESS"); - log.setReason("orderId=1"); - log.setIpAddress("127.0.0.1"); - log.setDeviceId("device-1"); - log.setOperateTime(LocalDateTime.now()); - Page page = new Page<>(2, 5); - page.setRecords(List.of(log)); - page.setTotal(11); - when(auditLogMapper.selectPage(any(Page.class), any(LambdaQueryWrapper.class))).thenReturn(page); - - PageResultVO result = service.pageLogs("admin", "ORDER_PROCESS", "SUCCESS", - LocalDateTime.now().minusDays(1), LocalDateTime.now(), 2, 5); - - assertThat(result.getTotal()).isEqualTo(11); - assertThat(result.getPage()).isEqualTo(2); - assertThat(result.getSize()).isEqualTo(5); - assertThat(result.getList()).hasSize(1); - assertThat(result.getList().get(0).getAction()).isEqualTo("ORDER_PROCESS"); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/support/PermissionCatalogTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/support/PermissionCatalogTest.java deleted file mode 100644 index 3f18ab18..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/security/support/PermissionCatalogTest.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.security.support; - -import org.junit.jupiter.api.Test; - -import java.util.Set; - -import static org.assertj.core.api.Assertions.assertThat; - -class PermissionCatalogTest { - - @Test - void announcementPermissionsUseChineseDisplayText() { - assertChinesePermission("announcement:view", "查看公告", "公告管理", "查看公告列表与详情"); - assertChinesePermission("announcement:create", "发布公告", "公告管理", "发布公告"); - assertChinesePermission("announcement:delete", "撤回公告", "公告管理", "撤回已发布公告"); - } - - @Test - void platformOnlyPermissionsAreAvailableToAdminAndOverviewMode() { - assertThat(PermissionCatalog.getDefaultPermissionCodes(4)) - .contains("messagehub:config:manage", "security:audit:view", "legal_agreement:manage"); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("user:create")).isTrue(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("user:balance:manage")).isTrue(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("shop:delete")).isTrue(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("permission:assign")).isTrue(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("message:create")).isTrue(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("announcement:create")).isTrue(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("messagehub:config:manage")).isTrue(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("security:audit:view")).isTrue(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("legal_agreement:manage")).isTrue(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("product:view")).isTrue(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("order:view")).isTrue(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("product:create")).isFalse(); - assertThat(PermissionCatalog.isAllowedForPlatformOverview("order:process")).isFalse(); - } - - @Test - void everyManagedDefaultPermissionHasDefinition() { - Set definedCodes = PermissionCatalog.getManagedPermissionCodes(); - assertThat(definedCodes) - .containsAll(PermissionCatalog.getDefaultPermissionCodes(4)) - .containsAll(PermissionCatalog.getDefaultPermissionCodes(2)) - .containsAll(PermissionCatalog.getDefaultPermissionCodes(3)); - } - - @Test - void nailArtistDefaultPermissionsAreWorkbenchOnly() { - assertThat(PermissionCatalog.getDefaultPermissionCodes(3)) - .contains("product:view", "tag:view", "coupon:view", "order:view", "order:process", "order:artist-change") - .doesNotContain("product:create", "product:edit", "product:delete", - "tag:create", "tag:edit", "tag:delete", - "user:create", "user:edit", "coupon:create", "coupon:assign"); - } - - @Test - void artistChangePermissionIsGrantedToProductionRoles() { - assertChinesePermission("order:artist-change", "处理改派申请", "订单管理", "处理订单美甲师改派申请"); - - assertThat(PermissionCatalog.getDefaultPermissionCodes(2)).contains("order:artist-change"); - assertThat(PermissionCatalog.getDefaultPermissionCodes(3)).contains("order:artist-change"); - } - - @Test - void vNextOperationsPermissionsAreGrantedByRole() { - assertThat(PermissionCatalog.getDefaultPermissionCodes(4)) - .contains("schedule:view", "schedule:edit", "payment:manage", "refund:manage", - "after_sale:view", "after_sale:audit", "inventory:view", "inventory:manage", - "campaign:view", "campaign:manage", "growth:view", "analytics:view", "performance:view"); - assertThat(PermissionCatalog.getDefaultPermissionCodes(2)) - .contains("schedule:view", "schedule:edit", "payment:view", "refund:view", - "after_sale:view", "after_sale:audit", "inventory:view", "inventory:manage", - "campaign:view", "campaign:manage", "analytics:view", "performance:view"); - assertThat(PermissionCatalog.getDefaultPermissionCodes(3)) - .contains("schedule:view", "after_sale:view", "performance:view") - .doesNotContain("payment:manage", "refund:manage", "inventory:manage", "campaign:manage"); - } - - @Test - void everyManagedDefaultPermissionUsesChineseDisplayText() { - PermissionCatalog.getManagedDefinitions().forEach(definition -> { - assertThat(definition.permissionName()).matches(PermissionCatalogTest::containsChinese); - assertThat(definition.permissionGroup()).matches(PermissionCatalogTest::containsChinese); - assertThat(definition.description()).matches(PermissionCatalogTest::containsChinese); - }); - } - - private void assertChinesePermission(String code, String name, String group, String description) { - PermissionCatalog.PermissionDefinition definition = PermissionCatalog.getRequiredDefinition(code); - assertThat(definition.permissionName()).isEqualTo(name); - assertThat(definition.permissionGroup()).isEqualTo(group); - assertThat(definition.description()).isEqualTo(description); - } - - private static boolean containsChinese(String value) { - return value != null && value.chars().anyMatch(codePoint -> codePoint >= 0x4E00 && codePoint <= 0x9FFF); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/impl/ShopServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/impl/ShopServiceImplTest.java deleted file mode 100644 index 6bb19760..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/impl/ShopServiceImplTest.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.shop.service.impl; - -import com.xiaowang.fingertipdesigner.core.config.AppCacheProperties; -import com.xiaowang.fingertipdesigner.core.modules.shop.dto.ShopDTO; -import com.xiaowang.fingertipdesigner.core.modules.order.entity.OrderArtistReviewDO; -import com.xiaowang.fingertipdesigner.core.modules.product.entity.ProductDO; -import com.xiaowang.fingertipdesigner.core.modules.shop.entity.ShopDO; -import com.xiaowang.fingertipdesigner.core.modules.content.mapper.CommentMapper; -import com.xiaowang.fingertipdesigner.core.modules.marketing.mapper.CouponMapper; -import com.xiaowang.fingertipdesigner.core.modules.order.mapper.OrderArtistReviewMapper; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.ProductMapper; -import com.xiaowang.fingertipdesigner.core.modules.shop.mapper.ShopMapper; -import com.xiaowang.fingertipdesigner.core.modules.product.mapper.TagMapper; -import com.xiaowang.fingertipdesigner.core.modules.marketing.mapper.UserCouponMapper; -import com.xiaowang.fingertipdesigner.core.modules.marketing.service.CouponService; -import com.xiaowang.fingertipdesigner.core.modules.integration.service.MapService; -import com.xiaowang.fingertipdesigner.core.modules.artist.service.NailArtistInfoService; -import com.xiaowang.fingertipdesigner.core.modules.file.service.ObjectStorageFileService; -import com.xiaowang.fingertipdesigner.core.modules.file.support.ObjectStorageUrlSupport; -import com.xiaowang.fingertipdesigner.core.modules.shop.support.UserShopBindingSupport; -import com.xiaowang.fingertipdesigner.core.support.cache.MultiLevelCacheService; -import com.xiaowang.fingertipdesigner.core.modules.file.vo.ObjectStorageFileVO; -import com.xiaowang.fingertipdesigner.core.modules.shop.vo.ShopTrustProfileVO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoInteractions; -import static org.mockito.Mockito.when; - -class ShopServiceImplTest { - @Mock - private ShopMapper shopMapper; - @Mock - private CouponService couponService; - @Mock - private CouponMapper couponMapper; - @Mock - private ProductMapper productMapper; - @Mock - private TagMapper tagMapper; - @Mock - private CommentMapper commentMapper; - @Mock - private UserCouponMapper userCouponMapper; - @Mock - private OrderArtistReviewMapper orderArtistReviewMapper; - @Mock - private ObjectStorageFileService objectStorageFileService; - @Mock - private ObjectStorageUrlSupport objectStorageUrlSupport; - @Mock - private UserShopBindingSupport userShopBindingSupport; - @Mock - private NailArtistInfoService nailArtistInfoService; - @Mock - private MultiLevelCacheService multiLevelCacheService; - @Mock - private AppCacheProperties appCacheProperties; - @Mock - private MapService mapService; - - private ShopServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new ShopServiceImpl( - shopMapper, - couponService, - couponMapper, - productMapper, - tagMapper, - commentMapper, - userCouponMapper, - orderArtistReviewMapper, - objectStorageFileService, - objectStorageUrlSupport, - userShopBindingSupport, - nailArtistInfoService, - multiLevelCacheService, - appCacheProperties, - mapService - ); - when(objectStorageUrlSupport.toAccessibleUrl(anyString())) - .thenAnswer(invocation -> invocation.getArgument(0, String.class)); - when(objectStorageUrlSupport.toAccessibleUrl(any(ObjectStorageFileVO.class))) - .thenAnswer(invocation -> invocation.getArgument(0, ObjectStorageFileVO.class).getFileUrl()); - } - - @Test - void deleteShopRejectsBusinessDeleteWithoutCascadeSoftDelete() { - assertThatThrownBy(() -> service.deleteShop(1L)) - .isInstanceOf(RuntimeException.class) - .hasMessage("店铺删除已停用,请使用停用封存"); - - verifyNoInteractions( - shopMapper, - couponMapper, - productMapper, - tagMapper, - commentMapper, - userCouponMapper, - userShopBindingSupport - ); - } - - @Test - void updateShopRejectsDisabledArchivedShop() { - ShopDO disabledShop = new ShopDO(); - disabledShop.setId(1L); - disabledShop.setStatus(0); - disabledShop.setIsDelete(0); - when(shopMapper.selectById(1L)).thenReturn(disabledShop); - - assertThatThrownBy(() -> service.updateShop(1L, new ShopDTO())) - .isInstanceOf(RuntimeException.class) - .hasMessage("停用店铺已封存,仅允许重新启用"); - - verify(shopMapper, never()).updateById(disabledShop); - } - - @Test - void getShopTrustProfileAggregatesPublicTrustDataWithoutContactPhone() { - ShopDO shop = new ShopDO(); - shop.setId(9L); - shop.setShopName("Yumi Test Shop"); - shop.setStatus(1); - shop.setIsDelete(0); - shop.setBusinessHours("10:00-20:00"); - shop.setImageFileIds("101,102"); - shop.setCoverImageFileId("100"); - shop.setCreateTime(LocalDateTime.now().minusDays(10)); - when(shopMapper.selectById(9L)).thenReturn(shop); - - ProductDO featured = new ProductDO(); - featured.setId(31L); - featured.setShopId(9L); - featured.setTitle("琉璃猫眼"); - featured.setDescription("透亮显白"); - featured.setPrice(new BigDecimal("168.00")); - featured.setImageFileIds("201"); - featured.setLikeCount(5); - featured.setCollectCount(12); - featured.setBookableArtists("7,8"); - featured.setIsDelete(0); - featured.setCreateTime(LocalDateTime.now().minusDays(1)); - when(productMapper.selectCount(any())).thenReturn(1L); - when(productMapper.selectList(any())).thenReturn(List.of(featured)); - - OrderArtistReviewDO submitted = new OrderArtistReviewDO(); - submitted.setId(51L); - submitted.setShopId(9L); - submitted.setProductId(31L); - submitted.setRatingScore(new BigDecimal("4.5")); - submitted.setContent("环境干净,做得很细"); - submitted.setStatus(1); - submitted.setIsDelete(0); - submitted.setSubmittedAt(LocalDateTime.now().minusHours(3)); - OrderArtistReviewDO pending = new OrderArtistReviewDO(); - pending.setId(52L); - pending.setShopId(9L); - pending.setRatingScore(new BigDecimal("1.0")); - pending.setContent("待评价不应展示"); - pending.setStatus(0); - pending.setIsDelete(0); - when(orderArtistReviewMapper.selectList(any())).thenReturn(List.of(submitted)); - when(orderArtistReviewMapper.selectCount(any())).thenReturn(1L); - - ObjectStorageFileVO cover = new ObjectStorageFileVO(); - cover.setId(100L); - cover.setFileUrl("https://img.test/cover.jpg"); - ObjectStorageFileVO env = new ObjectStorageFileVO(); - env.setId(101L); - env.setFileUrl("https://img.test/env.jpg"); - ObjectStorageFileVO productImage = new ObjectStorageFileVO(); - productImage.setId(201L); - productImage.setFileUrl("https://img.test/product.jpg"); - when(objectStorageFileService.getObjectStorageFileMapByIds(any())) - .thenReturn(Map.of(100L, cover, 101L, env, 201L, productImage)); - - ShopTrustProfileVO profile = service.getShopTrustProfile(9L); - - assertThat(profile).isNotNull(); - assertThat(profile.getShopId()).isEqualTo(9L); - assertThat(profile.getStats().getProductCount()).isEqualTo(1L); - assertThat(profile.getStats().getReviewCount()).isEqualTo(1L); - assertThat(profile.getStats().getAverageRating()).isEqualByComparingTo("4.5"); - assertThat(profile.getEnvironmentImages()).contains("https://img.test/cover.jpg", "https://img.test/env.jpg"); - assertThat(profile.getFeaturedProducts()).hasSize(1); - assertThat(profile.getFeaturedProducts().get(0).getImageUrl()).isEqualTo("https://img.test/product.jpg"); - assertThat(profile.getRecentReviews()).hasSize(1); - assertThat(profile.getRecentReviews().get(0).getContent()).isEqualTo("环境干净,做得很细"); - assertThat(profile.getContactSummary().getPhoneExposed()).isFalse(); - assertThat(profile.getContactSummary().getPhone()).isNull(); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/shop/support/ShopThemeSupportTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/shop/support/ShopThemeSupportTest.java deleted file mode 100644 index 909f5f37..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/shop/support/ShopThemeSupportTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.shop.support; - -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - -class ShopThemeSupportTest { - - @Test - void normalizeColorAcceptsOnlySixDigitHexAndUppercasesIt() { - assertThat(ShopThemeSupport.normalizeColor("#c6597d", "themePrimaryColor")).isEqualTo("#C6597D"); - assertThat(ShopThemeSupport.normalizeColor(" #ffffff ", "themeCardBgColor")).isEqualTo("#FFFFFF"); - } - - @Test - void normalizeColorTreatsBlankAsUnset() { - assertThat(ShopThemeSupport.normalizeColor(null, "themePrimaryColor")).isNull(); - assertThat(ShopThemeSupport.normalizeColor(" ", "themePrimaryColor")).isNull(); - } - - @Test - void normalizeColorRejectsUnsafeValues() { - assertThatThrownBy(() -> ShopThemeSupport.normalizeColor("#fff", "themePrimaryColor")) - .isInstanceOf(IllegalArgumentException.class) - .hasMessageContaining("themePrimaryColor"); - assertThatThrownBy(() -> ShopThemeSupport.normalizeColor("url(javascript:alert(1))", "themePrimaryColor")) - .isInstanceOf(IllegalArgumentException.class); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/system/service/impl/SystemParameterConfigServiceImplTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/system/service/impl/SystemParameterConfigServiceImplTest.java deleted file mode 100644 index 000e4167..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/system/service/impl/SystemParameterConfigServiceImplTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.system.service.impl; - -import com.xiaowang.fingertipdesigner.core.modules.system.dto.SystemParameterConfigDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.system.mapper.SystemParameterConfigMapper; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.mockito.Mockito.verifyNoInteractions; - -class SystemParameterConfigServiceImplTest { - - @Mock - private SystemParameterConfigMapper configMapper; - - private SystemParameterConfigServiceImpl service; - - @BeforeEach - void setUp() { - MockitoAnnotations.openMocks(this); - service = new SystemParameterConfigServiceImpl(configMapper); - } - - @Test - void saveConfigRejectsWeakAdminDefaultPassword() { - UserDO admin = new UserDO(); - admin.setType(4); - - SystemParameterConfigDTO dto = new SystemParameterConfigDTO(); - dto.setConfigGroup("USER"); - dto.setConfigKey("DEFAULT_PASSWORD"); - dto.setConfigName("后台新增用户默认密码"); - dto.setConfigValue("12345678"); - dto.setEnabled(1); - - assertThatThrownBy(() -> service.saveConfig(admin, dto)) - .isInstanceOf(RuntimeException.class) - .hasMessageContaining("默认密码"); - verifyNoInteractions(configMapper); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/system/support/AdminDefaultPasswordSupportTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/system/support/AdminDefaultPasswordSupportTest.java deleted file mode 100644 index bc6cf269..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/system/support/AdminDefaultPasswordSupportTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.system.support; - -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - -class AdminDefaultPasswordSupportTest { - - @Test - void resolveCreatePasswordUsesConfiguredDefaultWhenPasswordBlank() { - String password = AdminDefaultPasswordSupport.resolveCreatePassword(" ", " Config@123 "); - - assertThat(password).isEqualTo("Config@123"); - } - - @Test - void resolveCreatePasswordKeepsExplicitPassword() { - String password = AdminDefaultPasswordSupport.resolveCreatePassword(" User@1234 ", "Config@123"); - - assertThat(password).isEqualTo("User@1234"); - } - - @Test - void resolveDefaultPasswordFallsBackToStrongBuiltInDefault() { - String password = AdminDefaultPasswordSupport.resolveDefaultPassword(""); - - assertThat(password).isEqualTo(AdminDefaultPasswordSupport.FALLBACK_DEFAULT_PASSWORD); - } - - @Test - void validateDefaultPasswordRejectsWeakConfig() { - assertThatThrownBy(() -> AdminDefaultPasswordSupport.validateDefaultPassword("12345678")) - .isInstanceOf(RuntimeException.class) - .hasMessageContaining("默认密码"); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/user/service/impl/UserServiceImplPermissionAssignmentTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/user/service/impl/UserServiceImplPermissionAssignmentTest.java deleted file mode 100644 index 13c48305..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/user/service/impl/UserServiceImplPermissionAssignmentTest.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.user.service.impl; - -import com.xiaowang.fingertipdesigner.core.modules.security.mapper.PermissionMapper; -import com.xiaowang.fingertipdesigner.core.config.BrandProperties; -import com.xiaowang.fingertipdesigner.core.modules.shop.mapper.ShopMapper; -import com.xiaowang.fingertipdesigner.core.modules.user.mapper.UserInviteCodeMapper; -import com.xiaowang.fingertipdesigner.core.modules.user.mapper.UserMapper; -import com.xiaowang.fingertipdesigner.core.modules.security.mapper.UserPermissionMapper; -import com.xiaowang.fingertipdesigner.core.modules.user.mapper.UserRelationMapper; -import com.xiaowang.fingertipdesigner.core.modules.security.mapper.UserShopRoleMapper; -import com.xiaowang.fingertipdesigner.core.modules.integration.mapper.WechatMiniBindingMapper; -import com.xiaowang.fingertipdesigner.core.modules.auth.dto.RegisterRequestDTO; -import com.xiaowang.fingertipdesigner.core.modules.security.entity.PermissionDO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.artist.service.NailArtistInfoService; -import com.xiaowang.fingertipdesigner.core.modules.shop.service.ShopService; -import com.xiaowang.fingertipdesigner.core.modules.system.service.SystemParameterConfigService; -import com.xiaowang.fingertipdesigner.core.modules.auth.service.VerificationCodeService; -import com.xiaowang.fingertipdesigner.core.modules.file.support.ObjectStorageUrlSupport; -import com.xiaowang.fingertipdesigner.core.modules.security.support.PermissionCatalog; -import com.xiaowang.fingertipdesigner.core.modules.shop.support.UserShopBindingSupport; -import com.xiaowang.fingertipdesigner.core.support.id.TimeOrderedSnowflakeIdGenerator; -import com.xiaowang.fingertipdesigner.core.support.security.UserSessionService; -import com.xiaowang.fingertipdesigner.core.utils.JwtUtil; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.springframework.data.redis.core.StringRedisTemplate; - -import java.lang.reflect.Method; -import java.util.List; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoInteractions; -import static org.mockito.Mockito.when; -import static org.mockito.Mockito.doAnswer; -import static org.assertj.core.api.Assertions.assertThat; - -class UserServiceImplPermissionAssignmentTest { - - @Mock - private UserMapper userMapper; - - @Mock - private ShopMapper shopMapper; - - @Mock - private JwtUtil jwtUtil; - - @Mock - private ShopService shopService; - - @Mock - private UserPermissionMapper userPermissionMapper; - - @Mock - private PermissionMapper permissionMapper; - - @Mock - private UserRelationMapper userRelationMapper; - - @Mock - private UserInviteCodeMapper userInviteCodeMapper; - - @Mock - private BrandProperties brandProperties; - - @Mock - private UserShopRoleMapper userShopRoleMapper; - - @Mock - private NailArtistInfoService nailArtistInfoService; - - @Mock - private VerificationCodeService verificationCodeService; - - @Mock - private UserShopBindingSupport userShopBindingSupport; - - @Mock - private ObjectStorageUrlSupport objectStorageUrlSupport; - - @Mock - private StringRedisTemplate redisTemplate; - - @Mock - private TimeOrderedSnowflakeIdGenerator snowflakeIdGenerator; - - @Mock - private WechatMiniBindingMapper wechatMiniBindingMapper; - - @Mock - private UserSessionService userSessionService; - - @Mock - private SystemParameterConfigService systemParameterConfigService; - - private AutoCloseable mocks; - private UserServiceImpl service; - - @BeforeEach - void setUp() { - mocks = MockitoAnnotations.openMocks(this); - service = new UserServiceImpl( - userMapper, - shopMapper, - jwtUtil, - shopService, - userPermissionMapper, - permissionMapper, - userRelationMapper, - userInviteCodeMapper, - brandProperties, - userShopRoleMapper, - nailArtistInfoService, - verificationCodeService, - userShopBindingSupport, - objectStorageUrlSupport, - redisTemplate, - snowflakeIdGenerator, - wechatMiniBindingMapper, - userSessionService, - systemParameterConfigService - ); - } - - @AfterEach - void tearDown() throws Exception { - mocks.close(); - } - - @Test - void assignDefaultPermissionsSkipsPermissionSyncForPlainCustomer() throws Exception { - Method method = UserServiceImpl.class.getDeclaredMethod("assignDefaultPermissions", Long.class, Integer.class); - method.setAccessible(true); - - method.invoke(service, 1001L, 0); - - verifyNoInteractions(permissionMapper, userPermissionMapper); - } - - @Test - void ensurePermissionDefinitionsSkipsUnchangedExistingDefinitions() throws Exception { - when(permissionMapper.selectList(any())).thenReturn(existingManagedPermissionsFromCatalog()); - - Method method = UserServiceImpl.class.getDeclaredMethod("ensurePermissionDefinitions"); - method.setAccessible(true); - - method.invoke(service); - - verify(permissionMapper, never()).insert(any(PermissionDO.class)); - verify(permissionMapper, never()).updateById(any(PermissionDO.class)); - } - - @Test - void registerSkipsPermissionSyncForPlainCustomer() { - RegisterRequestDTO request = new RegisterRequestDTO(); - request.setAccount("codexregister1"); - request.setPassword("Abc123456"); - request.setNickname("Codex"); - request.setPhone("13900000001"); - request.setVerificationCode("123456"); - request.setShopId(1L); - - when(verificationCodeService.verifyCode("13900000001", "123456")).thenReturn(true); - when(userShopBindingSupport.isShopActive(1L)).thenReturn(true); - when(userMapper.selectOne(org.mockito.ArgumentMatchers.any())) - .thenReturn(null) - .thenReturn(null) - .thenReturn(new UserDO()); - doAnswer(invocation -> { - UserDO userDO = invocation.getArgument(0); - userDO.setId(42L); - return 1; - }).when(userMapper).insert(org.mockito.ArgumentMatchers.any()); - - assertThat(service.register(request)).isTrue(); - verifyNoInteractions(permissionMapper, userPermissionMapper); - } - - private static List existingManagedPermissionsFromCatalog() { - long id = 1L; - List permissions = new java.util.ArrayList<>(); - for (PermissionCatalog.PermissionDefinition definition : PermissionCatalog.getManagedDefinitions()) { - PermissionDO permission = new PermissionDO(); - permission.setId(id++); - permission.setPermissionCode(definition.permissionCode()); - permission.setPermissionName(definition.permissionName()); - permission.setPermissionGroup(definition.permissionGroup()); - permission.setDescription(definition.description()); - permission.setIsDelete(0); - permissions.add(permission); - } - return permissions; - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/user/support/UserProfileFieldSupportTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/user/support/UserProfileFieldSupportTest.java deleted file mode 100644 index 098fef67..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules/user/support/UserProfileFieldSupportTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.user.support; - -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - -class UserProfileFieldSupportTest { - - @Test - void requiresWechatIdForShopManagersAndNailArtists() { - assertThatThrownBy(() -> UserProfileFieldSupport.requireWechatIdForServiceUser(2, " ")) - .isInstanceOf(IllegalArgumentException.class) - .hasMessageContaining("微信号"); - assertThatThrownBy(() -> UserProfileFieldSupport.requireWechatIdForServiceUser(3, null)) - .isInstanceOf(IllegalArgumentException.class) - .hasMessageContaining("微信号"); - } - - @Test - void allowsBlankWechatIdForNormalUsersAndAdmins() { - UserProfileFieldSupport.requireWechatIdForServiceUser(0, " "); - UserProfileFieldSupport.requireWechatIdForServiceUser(4, null); - } - - @Test - void normalizesOptionalProfileText() { - assertThat(UserProfileFieldSupport.normalizeOptionalText(null)).isNull(); - assertThat(UserProfileFieldSupport.normalizeOptionalText(" ")).isNull(); - assertThat(UserProfileFieldSupport.normalizeOptionalText(" fingertip-designer-nail ")).isEqualTo("fingertip-designer-nail"); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/support/FingertipDesignerSqlSchemaTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/support/FingertipDesignerSqlSchemaTest.java deleted file mode 100644 index b86d3c19..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/support/FingertipDesignerSqlSchemaTest.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.support; - -import org.junit.jupiter.api.Test; - -import java.nio.file.Files; -import java.nio.file.Path; - -import static org.assertj.core.api.Assertions.assertThat; - -class FingertipDesignerSqlSchemaTest { - - private static final Path INIT_SQL_PATH = Path.of("../scripts/sql/init/FingertipDesigner.sql"); - - @Test - void balanceTableDefinesUpdateTimeColumnBeforeSeedMigrations() throws Exception { - String sql = Files.readString(INIT_SQL_PATH); - - assertThat(sql).containsPattern("(?is)create table t_balance\\s*\\([^;]*\\bupdate_time\\s+datetime"); - assertThat(sql).contains("CALL sp_add_column_if_not_exists('t_balance', 'update_time'"); - } - - @Test - void orderArtistReviewAndChangeSchemasAreSeeded() throws Exception { - String sql = Files.readString(INIT_SQL_PATH); - - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_order_artist_review"); - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_order_artist_change_request"); - assertThat(sql).contains("CALL sp_add_column_if_not_exists('t_system_message', 'business_type'"); - assertThat(sql).contains("CALL sp_add_column_if_not_exists('t_system_message', 'business_id'"); - assertThat(sql).contains("CALL sp_add_column_if_not_exists('t_system_message', 'action_path'"); - assertThat(sql).contains("CALL sp_add_column_if_not_exists('t_system_message', 'idempotency_key'"); - assertThat(sql).contains("CALL sp_add_unique_index_if_not_exists('t_system_message', 'uk_t_system_message_idempotency'"); - assertThat(sql).contains("pending_key"); - assertThat(sql).contains("EXPIRED"); - assertThat(sql).contains("idx_order_artist_change_expire"); - assertThat(sql).contains("CALL sp_add_unique_index_if_not_exists('t_order_artist_change_request', 'uk_order_artist_change_pending_key'"); - assertThat(sql).contains("'order:artist-change'"); - } - - @Test - void businessEventOutboxAndSecurityAuditPermissionAreSeeded() throws Exception { - String sql = Files.readString(INIT_SQL_PATH); - - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_business_event_outbox"); - assertThat(sql).contains("uk_business_event_outbox_event_key"); - assertThat(sql).contains("idx_business_event_outbox_due"); - assertThat(sql).contains("'security:audit:view'"); - } - - @Test - void tagSceneFilterColumnsAreSeeded() throws Exception { - String sql = Files.readString(INIT_SQL_PATH); - - assertThat(sql).contains("scene_group"); - assertThat(sql).contains("display_name"); - assertThat(sql).contains("front_visible"); - assertThat(sql).contains("idx_t_tag_front_filter"); - assertThat(sql).contains("CALL sp_add_column_if_not_exists('t_tag', 'scene_group'"); - assertThat(sql).contains("CALL sp_add_column_if_not_exists('t_tag', 'front_visible'"); - } - - @Test - void vNextOperationsSchemasAndPermissionsAreSeeded() throws Exception { - String sql = Files.readString(INIT_SQL_PATH); - - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_artist_schedule"); - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_appointment_reservation"); - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_payment_order"); - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_refund_order"); - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_after_sale"); - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_after_sale_log"); - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_inventory_item"); - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_inventory_record"); - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_campaign"); - assertThat(sql).contains("CREATE TABLE IF NOT EXISTS t_user_growth_record"); - assertThat(sql).contains("CALL sp_add_column_if_not_exists('t_order', 'payment_status'"); - assertThat(sql).contains("'schedule:view'"); - assertThat(sql).contains("'payment:manage'"); - assertThat(sql).contains("'after_sale:audit'"); - assertThat(sql).contains("'inventory:manage'"); - assertThat(sql).contains("'campaign:manage'"); - assertThat(sql).contains("'growth:view'"); - assertThat(sql).contains("'analytics:view'"); - assertThat(sql).contains("'performance:view'"); - assertThat(sql).contains("'workbench:view'"); - } - - @Test - void adminDefaultPasswordConfigIsSeeded() throws Exception { - String sql = Files.readString(INIT_SQL_PATH); - - assertThat(sql).contains("'USER', 'DEFAULT_PASSWORD'"); - assertThat(sql).contains("后台新增用户默认密码"); - } - @Test - void userProfileContactColumnsAreSeeded() throws Exception { - String sql = Files.readString(INIT_SQL_PATH); - - assertThat(sql).contains("contact_phone varchar(50)"); - assertThat(sql).contains("birthday date"); - assertThat(sql).contains("wechat_id varchar(100)"); - assertThat(sql).contains("wechat_qr_code varchar(512)"); - assertThat(sql).contains("CALL sp_add_column_if_not_exists('t_user', 'contact_phone'"); - assertThat(sql).contains("CALL sp_add_column_if_not_exists('t_user', 'wechat_qr_code'"); - } - - @Test - void objectStorageFileBackupColumnsAreSeeded() throws Exception { - String sql = Files.readString(INIT_SQL_PATH); - - assertThat(sql).contains("object_name"); - assertThat(sql).contains("primary_provider"); - assertThat(sql).contains("primary_url"); - assertThat(sql).contains("backup_provider"); - assertThat(sql).contains("backup_url"); - assertThat(sql).contains("content_type"); - assertThat(sql).contains("file_size"); - assertThat(sql).contains("primary_upload_status"); - assertThat(sql).contains("backup_upload_status"); - assertThat(sql).contains("backup_retry_count"); - assertThat(sql).contains("backup_last_error"); - assertThat(sql).contains("backup_uploaded_at"); - assertThat(sql).contains("backup_last_retry_time"); - assertThat(sql).contains("CALL sp_add_column_if_not_exists('t_object_storage_file', 'object_name'"); - assertThat(sql).contains("CALL sp_add_index_if_not_exists('t_object_storage_file', 'idx_object_storage_file_backup_retry'"); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/support/WishlistSqlSchemaTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/support/WishlistSqlSchemaTest.java deleted file mode 100644 index 2f9ac886..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/support/WishlistSqlSchemaTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.support; - -import org.junit.jupiter.api.Test; - -import java.nio.file.Files; -import java.nio.file.Path; - -import static org.assertj.core.api.Assertions.assertThat; - -class WishlistSqlSchemaTest { - - @Test - void wishlistGroupsAndMetadataAreSeededInInitSql() throws Exception { - String sql = Files.readString(Path.of("../scripts/sql/init/FingertipDesigner.sql")); - - assertWishlistSchema(sql); - } - - private void assertWishlistSchema(String sql) { - assertThat(sql).contains("t_wishlist_group"); - assertThat(sql).contains("group_id"); - assertThat(sql).contains("note"); - assertThat(sql).contains("sort_order"); - assertThat(sql).contains("最近想做"); - assertThat(sql).contains("婚礼款"); - assertThat(sql).contains("夏天款"); - assertThat(sql).contains("idx_t_wishlist_group_user"); - assertThat(sql).contains("idx_t_wishlist_group_sort"); - assertThat(sql).contains("idx_t_wishlist_group_sort"); - assertThat(sql).contains("idx_t_wishlist_user_group_sort"); - assertThat(sql).contains("sp_drop_auto_increment_on_id_if_exists('t_wishlist_group')"); - } -} diff --git a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/utils/JwtUtilTest.java b/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/utils/JwtUtilTest.java deleted file mode 100644 index 5b04a558..00000000 --- a/FD-Core/src/test/java/com/xiaowang/fingertipdesigner/core/utils/JwtUtilTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.utils; - -import com.xiaowang.fingertipdesigner.core.config.JwtProperties; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -class JwtUtilTest { - - @Test - void resolveAccessTokenExpirationSecondsShouldUseRememberMeSeconds() { - JwtProperties properties = new JwtProperties(); - properties.setAccessTokenExpirationSeconds(120L); - properties.setRememberMeAccessTokenExpirationSeconds(604800L); - JwtUtil jwtUtil = new JwtUtil(properties); - - assertThat(jwtUtil.resolveAccessTokenExpirationSeconds(false)).isEqualTo(120L); - assertThat(jwtUtil.resolveAccessTokenExpirationSeconds(true)).isEqualTo(604800L); - } -} diff --git a/FD-Frontend/src/router/index.ts b/FD-Frontend/src/router/index.ts deleted file mode 100644 index 7443a1ad..00000000 --- a/FD-Frontend/src/router/index.ts +++ /dev/null @@ -1,371 +0,0 @@ -import { createRouter, createWebHistory } from 'vue-router' -import { - canAccessAdminRoute, - clearAdminBootstrapSession, - ensureAdminAuthBootstrap, - getAdminBootstrapSnapshot, - resolveAdminLandingPath, -} from '@/utils/admin-auth-bootstrap' - -/** - * Purpose: router supports index.ts by holding or executing the router page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const router = createRouter({ - history: createWebHistory(import.meta.env.BASE_URL), - routes: [ - { - path: '/', - name: 'auth', - component: () => import('../views/AuthView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/home', - name: 'home', - component: () => import('../views/HomeView.vue'), - meta: { requiresAuth: false, isAdmin: false } - }, - { - path: '/products', - name: 'products', - component: () => import('../views/ProductListView.vue'), - meta: { requiresAuth: false, isAdmin: false } - }, - { - path: '/product/:id', - name: 'product-detail', - component: () => import('../views/ProductDetailView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/cart', - name: 'cart', - component: () => import('../views/CartView.vue'), - meta: { requiresAuth: true, isAdmin: false } - }, - { - path: '/profile', - name: 'profile', - component: () => import('../views/ProfileView.vue'), - meta: { requiresAuth: true, isAdmin: false } - }, - { - path: '/shop/:id', - name: 'shop-detail', - component: () => import('../views/ShopDetailView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/shop/:shopId/artists', - name: 'shop-artists', - component: () => import('../views/ArtistListView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/artist/:id', - name: 'artist-profile', - component: () => import('../views/ArtistProfileView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/wishlist', - name: 'wishlist', - component: () => import('../views/WishlistView.vue'), - meta: { requiresAuth: true, isAdmin: false } - }, - { - path: '/orders', - name: 'orders', - component: () => import('../views/OrderView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/orders/:id', - name: 'order-detail', - component: () => import('../views/OrderDetailView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/after-sales', - name: 'after-sales', - component: () => import('../views/AfterSalesView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/after-sale/apply', - name: 'after-sale-apply', - component: () => import('../views/AfterSaleApplyView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/service-progress', - name: 'service-progress', - component: () => import('../views/ServiceProgressView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/help', - name: 'help', - component: () => import('../views/HelpView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/artist-orders', - name: 'artist-orders', - component: () => import('../views/ArtistOrderView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false, permissionCode: 'order:view' } - }, - { - path: '/artist-calendar', - name: 'artist-calendar', - component: () => import('../views/ArtistCalendarView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false, permissionCode: 'order:view' } - }, - { - path: '/settings', - name: 'settings', - component: () => import('../views/SettingsView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/settings/account', - name: 'account-settings', - component: () => import('../views/AccountSettingsView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/settings/password', - name: 'password-settings', - component: () => import('../views/PasswordSettingsView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/coupons', - name: 'coupons', - component: () => import('../views/CouponView.vue'), - meta: { requiresAuth: true, isAdmin: false, hideNav: true } - }, - { - path: '/vip-center', - name: 'vip-center', - component: () => import('../views/VipCenterView.vue'), - meta: { requiresAuth: true, isAdmin: false, hideNav: true } - }, - { - path: '/notifications', - name: 'notifications', - component: () => import('../views/NotificationsView.vue'), - meta: { requiresAuth: true, isAdmin: false, hideNav: true } - }, - { - path: '/admin/login', - name: 'admin-login', - component: () => import('../views/admin/AdminLoginView.vue'), - meta: { requiresAuth: false, isAdmin: true, hideNav: true } - }, - { - path: '/admin', - component: () => import('../views/admin/AdminLayout.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true }, - children: [ - { - path: '', - name: 'admin', - component: () => import('../views/admin/HomeView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true } - }, - { - path: 'dashboard', - name: 'admin-dashboard', - component: () => import('../views/admin/DashboardView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'dashboard:view' } - }, - { - path: 'users', - name: 'admin-users', - component: () => import('../views/admin/UsersView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'user:view' } - }, - { - path: 'products', - name: 'admin-products', - component: () => import('../views/admin/ProductsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'product:view' } - }, - { - path: 'coupons', - name: 'admin-coupons', - component: () => import('../views/admin/CouponsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'coupon:view' } - }, - { - path: 'comments', - name: 'admin-comments', - component: () => import('../views/admin/CommentsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'comment:view' } - }, - { - path: 'shops', - name: 'admin-shops', - component: () => import('../views/admin/ShopsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'shop:view' } - }, - { - path: 'permissions', - name: 'admin-permissions', - component: () => import('../views/admin/PermissionsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'permission:view' } - }, - { - path: 'orders', - name: 'admin-orders', - component: () => import('../views/admin/OrdersView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'order:view' } - }, - { - path: 'schedules', - name: 'admin-schedules', - component: () => import('../views/admin/SchedulesView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'schedule:view' } - }, - { - path: 'after-sales', - name: 'admin-after-sales', - component: () => import('../views/admin/AfterSalesView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'after_sale:view' } - }, - { - path: 'inventory', - name: 'admin-inventory', - component: () => import('../views/admin/InventoryView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'inventory:view' } - }, - { - path: 'campaigns', - name: 'admin-campaigns', - component: () => import('../views/admin/CampaignsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'campaign:view' } - }, - { - path: 'manage', - name: 'admin-manage', - component: () => import('../views/admin/ManageView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true } - }, - { - path: 'profile', - name: 'admin-profile', - component: () => import('../views/admin/ProfileView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true } - }, - { - path: 'tags', - name: 'admin-tags', - component: () => import('../views/admin/TagsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'tag:view' } - }, - { - path: 'nail-artists', - name: 'admin-nail-artists', - component: () => import('../views/admin/NailArtistsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'nail_artist:view' } - }, - { - path: 'messages', - name: 'admin-messages', - component: () => import('../views/admin/SystemMessagesView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'message:view' } - }, - { - path: 'announcements', - name: 'admin-announcements', - component: () => import('../views/admin/AnnouncementsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'announcement:view' } - }, - { - path: 'vip-recharge-plans', - name: 'admin-vip-recharge-plans', - component: () => import('../views/admin/VipRechargePlansView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'user:vip:manage' } - }, - { - path: 'messagehub-push-configs', - name: 'admin-messagehub-push-configs', - component: () => import('../views/admin/MessageHubPushConfigsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'messagehub:config:manage' } - }, - { - path: 'legal-agreements', - name: 'admin-legal-agreements', - component: () => import('../views/admin/LegalAgreementsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'legal_agreement:manage' } - } - ] - }, - { - path: '/:pathMatch(.*)*', - name: 'not-found', - component: () => import('../views/NotFoundView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - } - ] -}) - -router.beforeEach(async (to) => { - const isAdminRoute = Boolean(to.meta.isAdmin) - const requiresAuth = Boolean(to.meta.requiresAuth) - - if (isAdminRoute) { - const snapshot = getAdminBootstrapSnapshot() - - if (to.path === '/admin/login') { - if (!snapshot.token || !snapshot.userInfo) { - return true - } - - const state = await ensureAdminAuthBootstrap() - return state === 'ready' ? resolveAdminLandingPath() : true - } - - if (requiresAuth && (!snapshot.token || !snapshot.userInfo)) { - clearAdminBootstrapSession() - return '/admin/login' - } - - const bootstrapState = await ensureAdminAuthBootstrap() - if (bootstrapState !== 'ready') { - return '/admin/login' - } - - if (!canAccessAdminRoute(to.path, to.meta.permissionCode as string | undefined)) { - return resolveAdminLandingPath() - } - - return true - } - - const token = localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken') - - if (requiresAuth && !token) { - return '/' - } - - if (to.path === '/' && token) { - return '/home' - } - - if (requiresAuth && token) { - const userInfo = localStorage.getItem('userInfo') - if (!userInfo) { - localStorage.removeItem('accessToken') - localStorage.removeItem('refreshToken') - sessionStorage.removeItem('accessToken') - return '/' - } - } - - return true -}) - -export default router diff --git a/FD-Frontend/src/views/admin/AdminLoginView.vue b/FD-Frontend/src/views/admin/AdminLoginView.vue deleted file mode 100644 index 71ccafb0..00000000 --- a/FD-Frontend/src/views/admin/AdminLoginView.vue +++ /dev/null @@ -1,514 +0,0 @@ - - - - - diff --git a/FD-Frontend/src/views/admin/NailArtistsView.vue b/FD-Frontend/src/views/admin/NailArtistsView.vue deleted file mode 100644 index 5f2a1d9a..00000000 --- a/FD-Frontend/src/views/admin/NailArtistsView.vue +++ /dev/null @@ -1,708 +0,0 @@ - - - - - diff --git a/FD-Frontend/src/views/admin/PermissionsView.vue b/FD-Frontend/src/views/admin/PermissionsView.vue deleted file mode 100644 index b94cbf89..00000000 --- a/FD-Frontend/src/views/admin/PermissionsView.vue +++ /dev/null @@ -1,835 +0,0 @@ - - - - - diff --git a/FD-Frontend/src/views/admin/ProductsView.vue b/FD-Frontend/src/views/admin/ProductsView.vue deleted file mode 100644 index 8ee3076f..00000000 --- a/FD-Frontend/src/views/admin/ProductsView.vue +++ /dev/null @@ -1,1602 +0,0 @@ - - - - - diff --git a/FD-Frontend/src/views/admin/ShopsView.vue b/FD-Frontend/src/views/admin/ShopsView.vue deleted file mode 100644 index 6fb932f7..00000000 --- a/FD-Frontend/src/views/admin/ShopsView.vue +++ /dev/null @@ -1,2795 +0,0 @@ - - - - - diff --git a/FD-Frontend/src/views/admin/TagsView.vue b/FD-Frontend/src/views/admin/TagsView.vue deleted file mode 100644 index 00d60070..00000000 --- a/FD-Frontend/src/views/admin/TagsView.vue +++ /dev/null @@ -1,662 +0,0 @@ - - - - - diff --git a/FD-Gateway/src/test/java/com/xiaowang/fingertipdesigner/gateway/filter/AuthGlobalFilterWhitelistTest.java b/FD-Gateway/src/test/java/com/xiaowang/fingertipdesigner/gateway/filter/AuthGlobalFilterWhitelistTest.java deleted file mode 100644 index c439a969..00000000 --- a/FD-Gateway/src/test/java/com/xiaowang/fingertipdesigner/gateway/filter/AuthGlobalFilterWhitelistTest.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.xiaowang.fingertipdesigner.gateway.filter; - -import com.xiaowang.fingertipdesigner.gateway.config.GatewayConfig; -import com.xiaowang.fingertipdesigner.gateway.filter.AuthGlobalFilter.AuthWhitelist; -import org.junit.jupiter.api.Test; -import org.springframework.core.io.ClassPathResource; -import org.springframework.util.AntPathMatcher; - -import java.nio.charset.StandardCharsets; -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; - -class AuthGlobalFilterWhitelistTest { - - private final AntPathMatcher pathMatcher = new AntPathMatcher(); - - @Test - void effectiveWhitelistCoversPublicCommentListAndRejectsOrderApi() { - GatewayConfig config = new GatewayConfig(); - config.setWhitelist(List.of("/api/user/login")); - - List patterns = AuthWhitelist.effectivePatterns(config); - - assertThat(matches(patterns, "/api/comment/list/product/1")).isTrue(); - assertThat(matches(patterns, "/api/order/list")).isFalse(); - assertThat(matches(patterns, "/api/admin/user/list")).isFalse(); - } - - @Test - void defaultWhitelistIncludesOnlyExpectedPublicBusinessAreas() { - assertThat(AuthWhitelist.defaultPatterns()) - .contains( - "/api/user/login", - "/api/comment/list/product/**", - "/api/admin/auth/login", - "/admin/auth/login", - "/api/nail-artist/profile/**", - "/api/nail-artist/*/availability", - "/api/nail-artist/*/reviews", - "/api/shop/list" - ) - .doesNotContain("/api/order/**", "/api/shop/delete/**", "/api/permission/**"); - } - - @Test - void directAdminLoginCompatibilityPathIsWhitelisted() { - assertThat(matches(AuthWhitelist.defaultPatterns(), "/admin/auth/login")).isTrue(); - assertThat(matches(AuthWhitelist.defaultPatterns(), "/admin/auth/login-shops/1")).isTrue(); - assertThat(matches(AuthWhitelist.defaultPatterns(), "/admin/auth/refresh")).isTrue(); - } - - @Test - void applicationRoutesDirectAdminAuthCompatibilityPath() throws Exception { - String yaml = new String(new ClassPathResource("application.yaml").getInputStream().readAllBytes(), StandardCharsets.UTF_8); - - assertThat(yaml).contains("Path=/admin/auth/**"); - } - - @Test - void applicationRoutesManagerApiThroughAdminRoute() throws Exception { - String yaml = new String(new ClassPathResource("application.yaml").getInputStream().readAllBytes(), StandardCharsets.UTF_8); - - assertThat(yaml) - .contains("Path=/api/admin/**") - .contains("RewritePath=/api/admin/(?.*), /admin/${remaining}"); - assertThat(matches(AuthWhitelist.defaultPatterns(), "/api/admin/manager/planning/calendar")).isFalse(); - } - - private boolean matches(List patterns, String path) { - return patterns.stream().anyMatch(pattern -> pathMatcher.match(pattern, path)); - } -} diff --git a/FD-WeChat-Fronted/admin/api/after-sale.js b/FD-WeChat-Fronted/admin/api/after-sale.js deleted file mode 100644 index d1dec16e..00000000 --- a/FD-WeChat-Fronted/admin/api/after-sale.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Purpose: request sends authenticated admin mini-program calls through the shared request wrapper. - * Usage: keep after-sale endpoints aligned with /admin/after-sale on the backend. - */ -const request = require('../utils/request') - -module.exports = { - listAfterSales(params) { - return request({ - url: '/after-sale/list', - params - }) - }, - - approveAfterSale(id, data) { - return request({ - url: `/after-sale/${id}/approve`, - method: 'PUT', - data: data || {} - }) - }, - - rejectAfterSale(id, data) { - return request({ - url: `/after-sale/${id}/reject`, - method: 'PUT', - data: data || {} - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/artist-schedule.js b/FD-WeChat-Fronted/admin/api/artist-schedule.js deleted file mode 100644 index cc135b90..00000000 --- a/FD-WeChat-Fronted/admin/api/artist-schedule.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Purpose: request sends authenticated admin mini-program calls through the shared request wrapper. - * Usage: keep schedule endpoints aligned with /admin/artist-schedule on the backend. - */ -const request = require('../utils/request') - -module.exports = { - listSchedules(params) { - return request({ - url: '/artist-schedule/list', - params - }) - }, - - saveSchedule(data) { - return request({ - url: '/artist-schedule/save', - method: 'POST', - data - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/auth.js b/FD-WeChat-Fronted/admin/api/auth.js deleted file mode 100644 index 85102bcd..00000000 --- a/FD-WeChat-Fronted/admin/api/auth.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Purpose: request supports auth.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: login supports auth.js by holding or executing the login page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - login(data) { - return request({ - url: '/auth/login', - method: 'POST', - data - }) - }, - - /** - * Purpose: getLoginShops supports auth.js by holding or executing the get login shops page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getLoginShops(account) { - return request({ - url: `/auth/login-shops/${encodeURIComponent(account)}` - }) - }, - - /** - * Purpose: switchShop supports auth.js by holding or executing the switch shop page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - switchShop(shopId) { - return request({ - url: '/auth/switch-shop', - method: 'POST', - data: { - shopId: shopId || undefined - } - }) - }, - - /** - * Purpose: refreshToken supports auth.js by holding or executing the refresh token page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - refreshToken(refreshToken) { - return request({ - url: '/auth/refresh', - method: 'POST', - data: { - refreshToken - } - }) - }, - - /** - * Purpose: logout supports auth.js by holding or executing the logout page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - logout() { - return request({ - url: '/auth/logout', - method: 'POST' - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/campaign.js b/FD-WeChat-Fronted/admin/api/campaign.js deleted file mode 100644 index 69fcc300..00000000 --- a/FD-WeChat-Fronted/admin/api/campaign.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Purpose: request sends authenticated admin mini-program calls through the shared request wrapper. - * Usage: keep campaign endpoints aligned with /admin/campaign on the backend. - */ -const request = require('../utils/request') - -module.exports = { - listCampaigns(params) { - return request({ - url: '/campaign/list', - params - }) - }, - - saveCampaign(data) { - return request({ - url: '/campaign/save', - method: 'POST', - data - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/comment.js b/FD-WeChat-Fronted/admin/api/comment.js deleted file mode 100644 index fc348fc9..00000000 --- a/FD-WeChat-Fronted/admin/api/comment.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Purpose: request supports comment.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: listComments supports comment.js by holding or executing the list comments page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listComments(params) { - return request({ - url: '/comment/list', - params - }) - }, - - /** - * Purpose: deleteComment supports comment.js by holding or executing the delete comment page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - deleteComment(id) { - return request({ - url: `/comment/delete/${id}`, - method: 'DELETE' - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/coupon.js b/FD-WeChat-Fronted/admin/api/coupon.js deleted file mode 100644 index caf8af3b..00000000 --- a/FD-WeChat-Fronted/admin/api/coupon.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Purpose: request supports coupon.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: listCoupons supports coupon.js by holding or executing the list coupons page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listCoupons(params) { - return request({ - url: '/coupon/list', - params - }) - }, - - /** - * Purpose: listAllCoupons supports coupon.js by holding or executing the list all coupons page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listAllCoupons(shopId) { - return request({ - url: '/coupon/list/all', - params: shopId ? { shopId } : undefined - }) - }, - - /** - * Purpose: getCouponDetail supports coupon.js by holding or executing the get coupon detail page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getCouponDetail(id) { - return request({ - url: `/coupon/detail/${id}` - }) - }, - - /** - * Purpose: createCoupon supports coupon.js by holding or executing the create coupon page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - createCoupon(data) { - return request({ - url: '/coupon/create', - method: 'POST', - data - }) - }, - - /** - * Purpose: updateCoupon supports coupon.js by holding or executing the update coupon page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - updateCoupon(id, data) { - return request({ - url: `/coupon/update/${id}`, - method: 'PUT', - data - }) - }, - - /** - * Purpose: deleteCoupon supports coupon.js by holding or executing the delete coupon page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - deleteCoupon(id) { - return request({ - url: `/coupon/delete/${id}`, - method: 'DELETE' - }) - }, - - /** - * Purpose: assignCoupon supports coupon.js by holding or executing the assign coupon page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - assignCoupon(data) { - return request({ - url: '/coupon/assign', - method: 'POST', - params: data, - data: {} - }) - }, - - /** - * Purpose: distributeCoupon supports coupon.js by holding or executing the distribute coupon page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - distributeCoupon(data) { - return request({ - url: '/coupon/distribute', - method: 'POST', - params: data, - data: {} - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/dashboard.js b/FD-WeChat-Fronted/admin/api/dashboard.js deleted file mode 100644 index 7e780c22..00000000 --- a/FD-WeChat-Fronted/admin/api/dashboard.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Purpose: request supports dashboard.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: getStats supports dashboard.js by holding or executing the get stats page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getStats() { - return request({ - url: '/dashboard/stats' - }) - }, - - getAnalytics() { - return request({ - url: '/dashboard/analytics' - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/file.js b/FD-WeChat-Fronted/admin/api/file.js deleted file mode 100644 index d9235031..00000000 --- a/FD-WeChat-Fronted/admin/api/file.js +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Purpose: request supports file.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') -/** - * Purpose: actionGuard supports file.js by holding or executing the action guard page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const actionGuard = require('../utils/action-guard') -const { ADMIN_API_BASE_URL, REQUEST_TIMEOUT } = require('../utils/config') - -/** - * Purpose: normalizeUploadResponse supports file.js by holding or executing the normalize upload response page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function normalizeUploadResponse(response) { - if (!response) { - throw new Error('上传失败') - } - - if (response.statusCode === 401) { - throw new Error('登录已过期,请重新登录') - } - - if (response.statusCode >= 400) { - throw new Error('上传失败') - } - - let payload = response.data - if (typeof payload === 'string') { - try { - payload = JSON.parse(payload) - } catch (error) {} - } - - if (payload && typeof payload === 'object' && Object.prototype.hasOwnProperty.call(payload, 'code')) { - if (payload.code === 200) { - return payload.data - } - throw new Error(payload.message || '上传失败') - } - - return payload -} - -module.exports = { - /** - * Purpose: initChunkUpload supports file.js by holding or executing the init chunk upload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - initChunkUpload(data) { - return request({ - url: '/object-storage-file/upload/init', - method: 'POST', - data - }) - }, - - /** - * Purpose: uploadChunkFile supports file.js by holding or executing the upload chunk file page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploadChunkFile(options) { - const signedHeaders = request.buildSignatureHeaders({ - url: '/object-storage-file/upload/chunk', - method: 'POST', - formData: { - uploadId: String(options.uploadId), - chunkIndex: String(options.chunkIndex), - totalChunks: String(options.totalChunks) - } - }) - - return actionGuard.run( - null, - `POST:/object-storage-file/upload/chunk:${String(options.uploadId)}:${String(options.chunkIndex)}`, - () => new Promise((resolve, reject) => { - const task = wx.uploadFile({ - url: `${ADMIN_API_BASE_URL}/object-storage-file/upload/chunk`, - filePath: options.filePath, - name: 'chunk', - timeout: REQUEST_TIMEOUT, - formData: { - uploadId: String(options.uploadId), - chunkIndex: String(options.chunkIndex), - totalChunks: String(options.totalChunks) - }, - header: signedHeaders, - success: response => { - try { - resolve(normalizeUploadResponse(response)) - } catch (error) { - reject(error) - } - }, - fail: error => { - reject(new Error(error.errMsg || '上传分片失败')) - } - }) - - if (task && typeof task.onProgressUpdate === 'function' && typeof options.onProgress === 'function') { - task.onProgressUpdate(progress => { - options.onProgress(progress) - }) - } - }), - { - message: '上传处理中,请勿重复操作' - } - ) - }, - - /** - * Purpose: completeChunkUpload supports file.js by holding or executing the complete chunk upload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - completeChunkUpload(uploadId) { - return request({ - url: '/object-storage-file/upload/complete', - method: 'POST', - data: { - uploadId - } - }) - }, - - /** - * Purpose: cancelChunkUpload supports file.js by holding or executing the cancel chunk upload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - cancelChunkUpload(uploadId) { - return request({ - url: `/object-storage-file/upload/${uploadId}`, - method: 'DELETE' - }) - }, - - /** - * Purpose: getSignedUrl supports file.js by holding or executing the get signed url page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getSignedUrl(fileId) { - return request({ - url: `/object-storage-file/get-signed-url/${fileId}` - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/inventory.js b/FD-WeChat-Fronted/admin/api/inventory.js deleted file mode 100644 index 66c8ae68..00000000 --- a/FD-WeChat-Fronted/admin/api/inventory.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Purpose: request sends authenticated admin mini-program calls through the shared request wrapper. - * Usage: keep inventory endpoints aligned with /admin/inventory on the backend. - */ -const request = require('../utils/request') - -module.exports = { - listItems(params) { - return request({ - url: '/inventory/list', - params - }) - }, - - saveItem(data) { - return request({ - url: '/inventory/save', - method: 'POST', - data - }) - }, - - adjustStock(id, data) { - return request({ - url: `/inventory/${id}/adjust`, - method: 'POST', - data - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/nail-artist.js b/FD-WeChat-Fronted/admin/api/nail-artist.js deleted file mode 100644 index 533ef813..00000000 --- a/FD-WeChat-Fronted/admin/api/nail-artist.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Purpose: request supports nail-artist.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: listNailArtists supports nail-artist.js by holding or executing the list nail artists page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listNailArtists() { - return request({ - url: '/nail-artist/list' - }) - }, - - /** - * Purpose: getNailArtistInfo supports nail-artist.js by holding or executing the get nail artist info page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getNailArtistInfo(userId) { - return request({ - url: `/nail-artist/get/${userId}` - }) - }, - - /** - * Purpose: saveNailArtistInfo supports nail-artist.js by holding or executing the save nail artist info page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - saveNailArtistInfo(data) { - return request({ - url: '/nail-artist/save', - method: 'POST', - data - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/order.js b/FD-WeChat-Fronted/admin/api/order.js deleted file mode 100644 index 871f5079..00000000 --- a/FD-WeChat-Fronted/admin/api/order.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Purpose: request supports order.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: listOrders supports order.js by holding or executing the list orders page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listOrders(params) { - return request({ - url: '/order/list', - params - }) - }, - - /** - * Purpose: getOrderDetail loads an authoritative admin-scoped order detail row. - * Usage: call with the order id when opening the order detail page so direct page entry works. - */ - getOrderDetail(id) { - return request({ - url: `/order/detail/${id}` - }) - }, - - /** - * Purpose: listOrderReviews supports order.js by holding or executing the list order reviews page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listOrderReviews(orderId) { - return request({ - url: `/order/${orderId}/reviews` - }) - }, - - /** - * Purpose: getArtistChangeOptions supports order.js by holding or executing the get artist change options page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getArtistChangeOptions(orderId, orderItemId) { - return request({ - url: `/order/${orderId}/artist-change/options`, - params: { - orderItemId - } - }) - }, - - /** - * Purpose: requestArtistChange supports order.js by holding or executing the request artist change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - requestArtistChange(data) { - return request({ - url: '/order/artist-change/request', - method: 'POST', - data - }) - }, - - /** - * Purpose: listMyPendingArtistChangeRequests supports order.js by holding or executing the list my pending artist change requests page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listMyPendingArtistChangeRequests() { - return request({ - url: '/order/artist-change/my-pending' - }) - }, - - /** - * Purpose: updateOrderStatus supports order.js by holding or executing the update order status page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - updateOrderStatus(id, status) { - return request({ - url: `/order/update-status/${id}`, - method: 'PUT', - params: { - status - }, - data: {} - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/payment.js b/FD-WeChat-Fronted/admin/api/payment.js deleted file mode 100644 index 900d941b..00000000 --- a/FD-WeChat-Fronted/admin/api/payment.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Purpose: request sends authenticated admin mini-program calls through the shared request wrapper. - * Usage: call manual payment operations only after UI permission checks; backend remains authoritative. - */ -const request = require('../utils/request') - -module.exports = { - manualConfirmOrder(orderId, remark) { - return request({ - url: `/payment/order/${orderId}/manual-confirm`, - method: 'POST', - params: { - remark - }, - data: {} - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/permission.js b/FD-WeChat-Fronted/admin/api/permission.js deleted file mode 100644 index 0ab021f2..00000000 --- a/FD-WeChat-Fronted/admin/api/permission.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Purpose: request supports permission.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: getCurrentUserPermissions supports permission.js by holding or executing the get current user permissions page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getCurrentUserPermissions() { - return request({ - url: '/permission/user/current' - }) - }, - - /** - * Purpose: getUserPermissions supports permission.js by holding or executing the get user permissions page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getUserPermissions(userId) { - return request({ - url: `/permission/user/${userId}` - }) - }, - - /** - * Purpose: getAssignablePermissionIds supports permission.js by holding or executing the get assignable permission ids page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getAssignablePermissionIds(userId) { - return request({ - url: `/permission/assignable/${userId}` - }) - }, - - /** - * Purpose: listAllPermissions supports permission.js by holding or executing the list all permissions page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listAllPermissions() { - return request({ - url: '/permission/list/all' - }) - }, - - /** - * Purpose: createPermission supports permission.js by holding or executing the create permission page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - createPermission(data) { - return request({ - url: '/permission/create', - method: 'POST', - data - }) - }, - - /** - * Purpose: updatePermission supports permission.js by holding or executing the update permission page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - updatePermission(id, data) { - return request({ - url: `/permission/update/${id}`, - method: 'PUT', - data - }) - }, - - /** - * Purpose: deletePermission supports permission.js by holding or executing the delete permission page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - deletePermission(id) { - return request({ - url: `/permission/delete/${id}`, - method: 'DELETE' - }) - }, - - /** - * Purpose: assignUserPermissions supports permission.js by holding or executing the assign user permissions page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - assignUserPermissions(userId, permissionIds) { - return request({ - url: `/permission/assign/${userId}`, - method: 'POST', - data: { - permissionIds - } - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/product.js b/FD-WeChat-Fronted/admin/api/product.js deleted file mode 100644 index 1fc4ff4b..00000000 --- a/FD-WeChat-Fronted/admin/api/product.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Purpose: request supports product.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: listProducts supports product.js by holding or executing the list products page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listProducts(params) { - return request({ - url: '/product/list', - params - }) - }, - - /** - * Purpose: listAllProducts supports product.js by holding or executing the list all products page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listAllProducts() { - return request({ - url: '/product/list/all' - }) - }, - - /** - * Purpose: createProduct supports product.js by holding or executing the create product page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - createProduct(data) { - return request({ - url: '/product/create', - method: 'POST', - data - }) - }, - - /** - * Purpose: updateProduct supports product.js by holding or executing the update product page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - updateProduct(id, data) { - return request({ - url: `/product/update/${id}`, - method: 'PUT', - data - }) - }, - - /** - * Purpose: deleteProduct supports product.js by holding or executing the delete product page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - deleteProduct(id) { - return request({ - url: `/product/delete/${id}`, - method: 'DELETE' - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/security-audit.js b/FD-WeChat-Fronted/admin/api/security-audit.js deleted file mode 100644 index b291d409..00000000 --- a/FD-WeChat-Fronted/admin/api/security-audit.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Purpose: request sends signed admin mini-program requests to the backend audit API. - * Usage: require this module from the audit page and call `listLogs` with filter params. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: listLogs loads read-only security audit log rows for authorized administrators. - * Usage: pass account, action, result, time range, page, and size filters, then render the returned page result. - */ - listLogs(params) { - return request({ - url: '/security-audit/logs', - params - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/shop.js b/FD-WeChat-Fronted/admin/api/shop.js deleted file mode 100644 index 78785af4..00000000 --- a/FD-WeChat-Fronted/admin/api/shop.js +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Purpose: request supports shop.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: listShops supports shop.js by holding or executing the list shops page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listShops(params) { - return request({ - url: '/shops/list', - params - }) - }, - - /** - * Purpose: listAllShops supports shop.js by holding or executing the list all shops page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listAllShops() { - return request({ - url: '/shops/list/all' - }) - }, - - /** - * Purpose: getShop supports shop.js by holding or executing the get shop page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getShop(id) { - return request({ - url: `/shops/${id}` - }) - }, - - /** - * Purpose: createShop supports shop.js by holding or executing the create shop page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - createShop(data) { - return request({ - url: '/shops/create', - method: 'POST', - data - }) - }, - - /** - * Purpose: updateShop supports shop.js by holding or executing the update shop page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - updateShop(id, data) { - return request({ - url: `/shops/update/${id}`, - method: 'PUT', - data - }) - }, - - /** - * Purpose: updateShopStatus supports shop.js by holding or executing the update shop status page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - updateShopStatus(id, status) { - return request({ - url: `/shops/status/${id}`, - method: 'PUT', - data: { - status - } - }) - }, - - /** - * Purpose: deleteShop supports shop.js by holding or executing the delete shop page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - deleteShop(id) { - return request({ - url: `/shops/delete/${id}`, - method: 'DELETE' - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/system-message.js b/FD-WeChat-Fronted/admin/api/system-message.js deleted file mode 100644 index d6f1cff8..00000000 --- a/FD-WeChat-Fronted/admin/api/system-message.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Purpose: request sends signed admin mini-program calls to the backend system-message endpoints. - * Usage: keep all system-message API wrappers in this module so pages do not build URLs by hand. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: listMessages loads admin-visible system messages including popup and business navigation metadata. - * Usage: call it from the system-message management page during initial load or refresh. - */ - listMessages() { - return request({ - url: '/system-message/admin/list' - }) - }, - - /** - * Purpose: createMessage publishes a new system message to the selected target users. - * Usage: pass validated form data with targetType, popupEnabled, and optional business fields. - */ - createMessage(data) { - return request({ - url: '/system-message/admin/create', - method: 'POST', - data - }) - }, - - /** - * Purpose: revokeMessage withdraws a previously published message when the operator has delete permission. - * Usage: call it with the message id after an explicit confirmation dialog. - */ - revokeMessage(id) { - return request({ - url: `/system-message/admin/${id}/revoke`, - method: 'PUT', - data: {} - }) - }, - - /** - * Purpose: getTargetOptions loads shops and users that the current operator may target. - * Usage: call it before showing the publish form so picker data is permission-scoped. - */ - getTargetOptions() { - return request({ - url: '/system-message/admin/target-options' - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/tag.js b/FD-WeChat-Fronted/admin/api/tag.js deleted file mode 100644 index 9b82ea2d..00000000 --- a/FD-WeChat-Fronted/admin/api/tag.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Purpose: request supports tag.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: listAllTags supports tag.js by holding or executing the list all tags page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listAllTags() { - return request({ - url: '/tag/list/all' - }) - }, - - /** - * Purpose: listTagsByShopId supports tag.js by holding or executing the list tags by shop id page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listTagsByShopId(shopId) { - return request({ - url: `/tag/list/by-shop/${shopId}` - }) - }, - - /** - * Purpose: getTagById supports tag.js by holding or executing the get tag by id page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getTagById(id) { - return request({ - url: `/tag/get/${id}` - }) - }, - - /** - * Purpose: createTag supports tag.js by holding or executing the create tag page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - createTag(data) { - return request({ - url: '/tag/create', - method: 'POST', - data - }) - }, - - /** - * Purpose: updateTag supports tag.js by holding or executing the update tag page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - updateTag(id, data) { - return request({ - url: `/tag/update/${id}`, - method: 'PUT', - data - }) - }, - - /** - * Purpose: deleteTag supports tag.js by holding or executing the delete tag page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - deleteTag(id) { - return request({ - url: `/tag/delete/${id}`, - method: 'DELETE' - }) - } -} diff --git a/FD-WeChat-Fronted/admin/api/user.js b/FD-WeChat-Fronted/admin/api/user.js deleted file mode 100644 index 3830c64c..00000000 --- a/FD-WeChat-Fronted/admin/api/user.js +++ /dev/null @@ -1,176 +0,0 @@ -/** - * Purpose: request supports user.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const request = require('../utils/request') - -module.exports = { - /** - * Purpose: listUsers supports user.js by holding or executing the list users page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listUsers(params) { - return request({ - url: '/user/list', - params - }) - }, - - /** - * Purpose: listAllUsers supports user.js by holding or executing the list all users page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listAllUsers() { - return request({ - url: '/user/list/all' - }) - }, - - /** - * Purpose: listArtists supports user.js by holding or executing the list artists page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - listArtists(shopId) { - return request({ - url: '/user/list/artists', - params: shopId ? { shopId } : undefined - }) - }, - - /** - * Purpose: createUser supports user.js by holding or executing the create user page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - createUser(data) { - return request({ - url: '/user/create', - method: 'POST', - data - }) - }, - - /** - * Purpose: updateUser supports user.js by holding or executing the update user page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - updateUser(id, data) { - return request({ - url: `/user/update/${id}`, - method: 'PUT', - data - }) - }, - - /** - * Purpose: updateUserStatus supports user.js by holding or executing the update user status page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - updateUserStatus(id, status) { - return request({ - url: `/user/status/${id}`, - method: 'PUT', - data: { - status - } - }) - }, - - /** - * Purpose: deleteUser supports user.js by holding or executing the delete user page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - deleteUser(id) { - return request({ - url: `/user/delete/${id}`, - method: 'DELETE' - }) - }, - - /** - * Purpose: unbindUser supports user.js by holding or executing the unbind user page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - unbindUser(id) { - return request({ - url: `/user/unbind/${id}`, - method: 'PUT', - data: {} - }) - }, - - /** - * Purpose: resetPassword supports user.js by holding or executing the reset password page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - resetPassword(id) { - return request({ - url: `/user/reset-password/${id}`, - method: 'POST' - }) - }, - - /** - * Purpose: getCurrentUserInfo supports user.js by holding or executing the get current user info page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getCurrentUserInfo() { - return request({ - url: '/user/info' - }) - }, - - /** - * Purpose: getUserAsset supports user.js by holding or executing the get user asset page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getUserAsset(id) { - return request({ - url: `/user/${id}/asset` - }) - }, - - /** - * Purpose: getUserBalanceHistory supports user.js by holding or executing the get user balance history page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - getUserBalanceHistory(id) { - return request({ - url: `/user/${id}/balance/history` - }) - }, - - /** - * Purpose: changeUserBalance supports user.js by holding or executing the change user balance page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - changeUserBalance(id, data) { - return request({ - url: `/user/${id}/balance/change`, - method: 'POST', - data - }) - }, - - /** - * Purpose: overrideUserVip supports user.js by holding or executing the override user vip page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - overrideUserVip(id, data) { - return request({ - url: `/user/${id}/vip/override`, - method: 'POST', - data - }) - }, - - /** - * Purpose: recalculateUserVip supports user.js by holding or executing the recalculate user vip page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - recalculateUserVip(id) { - return request({ - url: `/user/${id}/vip/recalculate`, - method: 'POST' - }) - } -} diff --git a/FD-WeChat-Fronted/admin/app.wxss b/FD-WeChat-Fronted/admin/app.wxss deleted file mode 100644 index a5bb9154..00000000 --- a/FD-WeChat-Fronted/admin/app.wxss +++ /dev/null @@ -1,508 +0,0 @@ -page { - min-height: 100%; - background: - radial-gradient(circle at top left, rgba(240, 126, 87, 0.18), transparent 30%), - linear-gradient(180deg, #071417 0%, #0d2225 30%, #f5f0e8 30%, #f5f0e8 100%); - color: #132024; - font-size: 28rpx; -} - -view, -text, -button, -input, -textarea, -scroll-view, -swiper, -swiper-item, -picker, -label, -image, -checkbox, -checkbox-group { - box-sizing: border-box; -} - -image { - display: block; -} - -button { - margin: 0; - padding: 0; - line-height: 1; - background: transparent; -} - -button::after { - border: 0; -} - -.page-shell { - min-height: 100vh; - padding-bottom: calc(env(safe-area-inset-bottom) + 36rpx); -} - -.page-stack { - padding: 24rpx; -} - -.hero-panel { - padding: 34rpx 30rpx; - border-radius: 36rpx; - background: linear-gradient(140deg, rgba(8, 21, 24, 0.96) 0%, rgba(20, 51, 52, 0.96) 100%); - color: #f6efe7; - box-shadow: 0 26rpx 64rpx rgba(7, 20, 23, 0.28); -} - -.hero-kicker { - display: block; - font-size: 22rpx; - font-weight: 700; - letter-spacing: 3rpx; - color: #f7b296; -} - -.hero-title { - display: block; - margin-top: 16rpx; - font-size: 48rpx; - line-height: 1.2; - font-weight: 800; -} - -.hero-desc { - display: block; - margin-top: 16rpx; - font-size: 24rpx; - line-height: 1.8; - color: rgba(246, 239, 231, 0.78); -} - -.surface-card { - margin-top: 24rpx; - padding: 28rpx; - border-radius: 30rpx; - background: rgba(255, 252, 247, 0.96); - border: 1rpx solid rgba(19, 32, 36, 0.08); - box-shadow: 0 18rpx 44rpx rgba(26, 39, 42, 0.08); -} - -.section-title { - display: block; - font-size: 34rpx; - font-weight: 800; - color: #132024; -} - -.section-desc { - display: block; - margin-top: 10rpx; - font-size: 24rpx; - line-height: 1.7; - color: #60706d; -} - -.field-group { - margin-top: 24rpx; -} - -.field-label { - display: block; - margin-bottom: 12rpx; - font-size: 24rpx; - font-weight: 700; - color: #294248; -} - -.field-input, -.field-picker, -.field-textarea { - width: 100%; - min-height: 92rpx; - padding: 0 24rpx; - border-radius: 24rpx; - background: #eef1ea; - border: 1rpx solid rgba(19, 32, 36, 0.08); - color: #132024; - font-size: 28rpx; -} - -.field-picker { - display: flex; - align-items: center; -} - -.field-textarea { - min-height: 200rpx; - padding: 24rpx; -} - -.placeholder { - color: #9eaaa5; -} - -.status-text { - display: block; - margin-top: 10rpx; - font-size: 22rpx; - line-height: 1.6; -} - -.status-text.success { - color: #2d8d60; -} - -.status-text.error { - color: #be4f3b; -} - -.status-text.warning { - color: #a66817; -} - -.primary-btn, -.secondary-btn, -.danger-btn { - display: flex; - align-items: center; - justify-content: center; - width: 100%; - min-height: 88rpx; - padding: 0 28rpx; - border-radius: 999rpx; - font-size: 28rpx; - font-weight: 700; -} - -.primary-btn { - background: linear-gradient(135deg, #f8a37c 0%, #f07e57 100%); - color: #fffaf4; -} - -.secondary-btn { - background: rgba(8, 21, 24, 0.04); - color: #173036; - border: 1rpx solid rgba(8, 21, 24, 0.1); -} - -.danger-btn { - background: rgba(190, 79, 59, 0.12); - color: #b94432; -} - -.action-row { - display: flex; - gap: 16rpx; - margin-top: 24rpx; -} - -.action-row .primary-btn, -.action-row .secondary-btn, -.action-row .danger-btn { - flex: 1; -} - -.badge-row { - display: flex; - flex-wrap: wrap; - gap: 12rpx; - margin-top: 18rpx; -} - -.badge, -.soft-badge, -.danger-badge, -.success-badge { - display: inline-flex; - align-items: center; - justify-content: center; - min-height: 48rpx; - padding: 0 18rpx; - border-radius: 999rpx; - font-size: 22rpx; - font-weight: 700; -} - -.badge { - background: rgba(240, 126, 87, 0.14); - color: #d05f3d; -} - -.soft-badge { - background: rgba(8, 21, 24, 0.06); - color: #50625f; -} - -.danger-badge { - background: rgba(190, 79, 59, 0.12); - color: #b94432; -} - -.success-badge { - background: rgba(45, 141, 96, 0.12); - color: #2d8d60; -} - -.stats-grid { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 16rpx; - margin-top: 22rpx; -} - -.stat-card { - padding: 24rpx; - border-radius: 24rpx; - background: rgba(8, 21, 24, 0.04); -} - -.stat-label { - display: block; - font-size: 22rpx; - color: #667774; -} - -.stat-value { - display: block; - margin-top: 10rpx; - font-size: 34rpx; - font-weight: 800; - color: #132024; -} - -.stat-note { - display: block; - margin-top: 8rpx; - font-size: 22rpx; - color: #7b8a87; -} - -.list-card { - margin-top: 18rpx; - padding: 24rpx; - border-radius: 26rpx; - background: #ffffff; - border: 1rpx solid rgba(19, 32, 36, 0.08); -} - -.list-head { - display: flex; - align-items: flex-start; - justify-content: space-between; - gap: 16rpx; -} - -.list-title { - display: block; - font-size: 30rpx; - line-height: 1.5; - font-weight: 800; - color: #132024; -} - -.list-subtitle { - display: block; - margin-top: 8rpx; - font-size: 22rpx; - color: #768582; -} - -.meta-grid { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 12rpx 20rpx; - margin-top: 22rpx; -} - -.meta-item { - min-width: 0; -} - -.meta-label { - display: block; - font-size: 21rpx; - color: #82918e; -} - -.meta-value { - display: block; - margin-top: 6rpx; - font-size: 25rpx; - color: #1b3035; - word-break: break-all; -} - -.list-actions { - display: flex; - flex-wrap: wrap; - gap: 12rpx; - margin-top: 22rpx; -} - -.admin-bottom-nav { - display: grid; - grid-template-columns: repeat(4, minmax(0, 1fr)); - gap: 10rpx; - margin-top: 24rpx; - padding: 12rpx; - border-radius: 28rpx; - background: rgba(8, 21, 24, 0.08); -} - -.admin-bottom-link { - display: flex; - align-items: center; - justify-content: center; - min-width: 0; - min-height: 68rpx; - border-radius: 999rpx; - color: #50625f; - font-size: 24rpx; - font-weight: 700; -} - -.admin-bottom-link.active { - background: rgba(240, 126, 87, 0.18); - color: #c85b39; -} - -.mini-btn { - display: inline-flex; - align-items: center; - justify-content: center; - min-width: 132rpx; - min-height: 62rpx; - padding: 0 20rpx; - border-radius: 999rpx; - background: rgba(8, 21, 24, 0.05); - color: #173036; - font-size: 24rpx; - font-weight: 700; -} - -.mini-btn.primary { - background: rgba(240, 126, 87, 0.14); - color: #cf5e3c; -} - -.mini-btn.danger { - background: rgba(190, 79, 59, 0.12); - color: #b94432; -} - -.search-row, -.filter-row { - display: flex; - gap: 14rpx; - margin-top: 18rpx; -} - -.search-input { - flex: 1; -} - -.chip-row, -.checkbox-grid { - display: flex; - flex-wrap: wrap; - gap: 12rpx; - margin-top: 18rpx; -} - -.chip-btn, -.checkbox-chip { - display: inline-flex; - align-items: center; - justify-content: center; - min-height: 60rpx; - padding: 0 20rpx; - border-radius: 999rpx; - background: rgba(8, 21, 24, 0.05); - color: #4d625f; - font-size: 24rpx; - font-weight: 700; -} - -.chip-btn.active, -.checkbox-chip.active { - background: rgba(240, 126, 87, 0.16); - color: #c85b39; -} - -.checkbox-chip.disabled { - opacity: 0.45; -} - -.empty-state { - margin-top: 24rpx; - padding: 72rpx 36rpx; - border-radius: 30rpx; - background: rgba(255, 252, 247, 0.8); - text-align: center; -} - -.empty-title { - display: block; - font-size: 34rpx; - font-weight: 800; - color: #132024; -} - -.empty-desc { - display: block; - margin-top: 14rpx; - font-size: 24rpx; - line-height: 1.8; - color: #758582; -} - -.fab { - position: fixed; - right: 28rpx; - bottom: calc(env(safe-area-inset-bottom) + 128rpx); - display: flex; - align-items: center; - justify-content: center; - width: 112rpx; - height: 112rpx; - border-radius: 999rpx; - background: linear-gradient(135deg, #f8a37c 0%, #f07e57 100%); - color: #fffaf4; - box-shadow: 0 22rpx 50rpx rgba(240, 126, 87, 0.3); - font-size: 38rpx; - font-weight: 800; -} - -.hint-card { - margin-top: 18rpx; - padding: 20rpx 22rpx; - border-radius: 24rpx; - background: rgba(240, 126, 87, 0.12); - color: #8f4d33; - font-size: 24rpx; - line-height: 1.75; -} - -.divider-line { - width: 100%; - height: 2rpx; - margin: 18rpx 0; - background: rgba(19, 32, 36, 0.08); -} - -.image-grid { - display: grid; - grid-template-columns: repeat(3, minmax(0, 1fr)); - gap: 14rpx; - margin-top: 18rpx; -} - -.image-chip { - padding: 18rpx 14rpx; - border-radius: 24rpx; - background: rgba(8, 21, 24, 0.04); - font-size: 22rpx; - color: #50625f; - line-height: 1.6; -} diff --git a/FD-WeChat-Fronted/admin/assets/tabbar/manage-active.png b/FD-WeChat-Fronted/admin/assets/tabbar/manage-active.png deleted file mode 100644 index 1d028ac9..00000000 Binary files a/FD-WeChat-Fronted/admin/assets/tabbar/manage-active.png and /dev/null differ diff --git a/FD-WeChat-Fronted/admin/assets/tabbar/manage.png b/FD-WeChat-Fronted/admin/assets/tabbar/manage.png deleted file mode 100644 index 61b48e4d..00000000 Binary files a/FD-WeChat-Fronted/admin/assets/tabbar/manage.png and /dev/null differ diff --git a/FD-WeChat-Fronted/admin/assets/tabbar/orders-active.png b/FD-WeChat-Fronted/admin/assets/tabbar/orders-active.png deleted file mode 100644 index 7bcecca6..00000000 Binary files a/FD-WeChat-Fronted/admin/assets/tabbar/orders-active.png and /dev/null differ diff --git a/FD-WeChat-Fronted/admin/assets/tabbar/orders.png b/FD-WeChat-Fronted/admin/assets/tabbar/orders.png deleted file mode 100644 index 40e96cf9..00000000 Binary files a/FD-WeChat-Fronted/admin/assets/tabbar/orders.png and /dev/null differ diff --git a/FD-WeChat-Fronted/admin/assets/tabbar/workbench-active.png b/FD-WeChat-Fronted/admin/assets/tabbar/workbench-active.png deleted file mode 100644 index f9bf6807..00000000 Binary files a/FD-WeChat-Fronted/admin/assets/tabbar/workbench-active.png and /dev/null differ diff --git a/FD-WeChat-Fronted/admin/assets/tabbar/workbench.png b/FD-WeChat-Fronted/admin/assets/tabbar/workbench.png deleted file mode 100644 index 93ace6d6..00000000 Binary files a/FD-WeChat-Fronted/admin/assets/tabbar/workbench.png and /dev/null differ diff --git a/FD-WeChat-Fronted/admin/components/navigation-bar/navigation-bar.js b/FD-WeChat-Fronted/admin/components/navigation-bar/navigation-bar.js deleted file mode 100644 index 5a2d36c9..00000000 --- a/FD-WeChat-Fronted/admin/components/navigation-bar/navigation-bar.js +++ /dev/null @@ -1,147 +0,0 @@ -Component({ - options: { - multipleSlots: true // 在组件定义时的选项中启用多slot支持 - }, - /** - * 组件的属性列表 - */ - properties: { - extClass: { - type: String, - value: '' - }, - title: { - type: String, - value: '' - }, - background: { - type: String, - value: '' - }, - color: { - type: String, - value: '' - }, - back: { - type: Boolean, - value: true - }, - loading: { - type: Boolean, - value: false - }, - homeButton: { - type: Boolean, - value: false, - }, - animated: { - // 显示隐藏的时候opacity动画效果 - type: Boolean, - value: true - }, - show: { - // 显示隐藏导航,隐藏的时候navigation-bar的高度占位还在 - type: Boolean, - value: true, - observer: '_showChange' - }, - // back为true的时候,返回的页面深度 - delta: { - type: Number, - value: 1 - }, - }, - /** - * 组件的初始数据 - */ - data: { - /** - * Purpose: displayStyle supports navigation-bar.js by holding or executing the display style page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayStyle: '' - }, - /** - * Purpose: lifetimes supports navigation-bar.js by holding or executing the lifetimes page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - lifetimes: { - attached() { - const rect = wx.getMenuButtonBoundingClientRect() - const platform = (wx.getDeviceInfo() || wx.getSystemInfoSync()).platform - const isAndroid = platform === 'android' - const isDevtools = platform === 'devtools' - const { windowWidth, safeArea: { top = 0, bottom = 0 } = {} } = wx.getWindowInfo() || wx.getSystemInfoSync() - this.setData({ - /** - * Purpose: ios supports navigation-bar.js by holding or executing the ios page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - ios: !isAndroid, - /** - * Purpose: innerPaddingRight supports navigation-bar.js by holding or executing the inner padding right page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - innerPaddingRight: `padding-right: ${windowWidth - rect.left}px`, - /** - * Purpose: leftWidth supports navigation-bar.js by holding or executing the left width page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - leftWidth: `width: ${windowWidth - rect.left}px`, - /** - * Purpose: safeAreaTop supports navigation-bar.js by holding or executing the safe area top page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - safeAreaTop: isDevtools || isAndroid ? `height: calc(var(--height) + ${top}px); padding-top: ${top}px` : `` - }) - }, - }, - /** - * 组件的方法列表 - */ - methods: { - _showChange(show) { - const animated = this.data.animated - let displayStyle = '' - if (animated) { - displayStyle = `opacity: ${show ? '1' : '0' - };transition:opacity 0.5s;` - } else { - displayStyle = `display: ${show ? '' : 'none'}` - } - this.setData({ - displayStyle - }) - }, - back() { - const data = this.data - const pages = getCurrentPages() - if (data.delta && pages.length > data.delta) { - wx.navigateBack({ - /** - * Purpose: delta supports navigation-bar.js by holding or executing the delta page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - delta: data.delta - }) - return - } - this.triggerEvent('back', { delta: data.delta }, {}) - }, - home() { - wx.redirectTo({ - /** - * Purpose: url supports navigation-bar.js by holding or executing the url page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - url: '/admin/pages/workbench/index', - fail() { - wx.reLaunch({ - url: '/admin/pages/workbench/index' - }) - } - }) - this.triggerEvent('home', {}, {}) - } - }, -}) diff --git a/FD-WeChat-Fronted/admin/components/navigation-bar/navigation-bar.wxml b/FD-WeChat-Fronted/admin/components/navigation-bar/navigation-bar.wxml deleted file mode 100644 index a1b76a1f..00000000 --- a/FD-WeChat-Fronted/admin/components/navigation-bar/navigation-bar.wxml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{title}} - - - - - - - - - - - - diff --git a/FD-WeChat-Fronted/admin/components/navigation-bar/navigation-bar.wxss b/FD-WeChat-Fronted/admin/components/navigation-bar/navigation-bar.wxss deleted file mode 100644 index e31640f5..00000000 --- a/FD-WeChat-Fronted/admin/components/navigation-bar/navigation-bar.wxss +++ /dev/null @@ -1,99 +0,0 @@ -.weui-navigation-bar { - --weui-FG-0:rgba(0,0,0,.9); - --height: 44px; - --left: 16px; -} -.weui-navigation-bar .android { - --height: 48px; -} - -.weui-navigation-bar { - overflow: hidden; - color: var(--weui-FG-0); - flex: none; - position: relative; - z-index: 20; -} - -.weui-navigation-bar__inner { - position: relative; - top: 0; - left: 0; - z-index: 1; - height: calc(var(--height) + env(safe-area-inset-top)); - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - padding-top: env(safe-area-inset-top); - width: 100%; - box-sizing: border-box; -} - -.weui-navigation-bar__left { - position: relative; - padding-left: var(--left); - display: flex; - flex-direction: row; - align-items: flex-start; - height: 100%; - box-sizing: border-box; -} - -.weui-navigation-bar__btn_goback_wrapper { - padding: 11px 18px 11px 16px; - margin: -11px -18px -11px -16px; -} - -.weui-navigation-bar__btn_goback_wrapper.weui-active { - opacity: 0.5; -} - -.weui-navigation-bar__btn_goback { - font-size: 12px; - width: 12px; - height: 24px; - -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%; - mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%; - -webkit-mask-size: cover; - mask-size: cover; - background-color: currentColor; -} - -.weui-navigation-bar__center { - font-size: 17px; - text-align: center; - position: relative; - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - font-weight: bold; - flex: 1; - height: 100%; -} - -.weui-navigation-bar__loading { - margin-right: 4px; - align-items: center; -} - -.weui-loading { - font-size: 16px; - width: 16px; - height: 16px; - display: block; - background: transparent url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='80px' height='80px' viewBox='0 0 80 80' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Eloading%3C/title%3E%3Cdefs%3E%3ClinearGradient x1='94.0869141%25' y1='0%25' x2='94.0869141%25' y2='90.559082%25' id='linearGradient-1'%3E%3Cstop stop-color='%23606060' stop-opacity='0' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3ClinearGradient x1='100%25' y1='8.67370605%25' x2='100%25' y2='90.6286621%25' id='linearGradient-2'%3E%3Cstop stop-color='%23606060' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.9'%3E%3Cg%3E%3Cpath d='M40,0 C62.09139,0 80,17.90861 80,40 C80,62.09139 62.09139,80 40,80 L40,73 C58.2253967,73 73,58.2253967 73,40 C73,21.7746033 58.2253967,7 40,7 L40,0 Z' fill='url(%23linearGradient-1)'%3E%3C/path%3E%3Cpath d='M40,0 L40,7 C21.7746033,7 7,21.7746033 7,40 C7,58.2253967 21.7746033,73 40,73 L40,80 C17.90861,80 0,62.09139 0,40 C0,17.90861 17.90861,0 40,0 Z' fill='url(%23linearGradient-2)'%3E%3C/path%3E%3Ccircle id='Oval' fill='%23606060' cx='40.5' cy='3.5' r='3.5'%3E%3C/circle%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A") no-repeat; - background-size: 100%; - margin-left: 0; - animation: loading linear infinite 1s; -} - -@keyframes loading { - from { - transform: rotate(0); - } - to { - transform: rotate(360deg); - } -} diff --git a/FD-WeChat-Fronted/admin/pages/after-sales/index.js b/FD-WeChat-Fronted/admin/pages/after-sales/index.js deleted file mode 100644 index 50a618a4..00000000 --- a/FD-WeChat-Fronted/admin/pages/after-sales/index.js +++ /dev/null @@ -1,166 +0,0 @@ -const afterSaleApi = require('../../api/after-sale') -const navigation = require('../../utils/navigation') -const permission = require('../../utils/permission') -const format = require('../../utils/format') -const { markDirty } = require('../../utils/page-state') - -const STATUS_OPTIONS = [ - { label: '全部', value: '' }, - { label: '待处理', value: 'PENDING' }, - { label: '已同意', value: 'APPROVED' }, - { label: '已驳回', value: 'REJECTED' } -] - -function safeList(response) { - if (Array.isArray(response && response.list)) { - return response.list - } - if (Array.isArray(response && response.records)) { - return response.records - } - return [] -} - -function statusText(status) { - if (status === 'PENDING') { - return '待处理' - } - if (status === 'APPROVED') { - return '已同意' - } - if (status === 'REJECTED') { - return '已驳回' - } - return status || '--' -} - -Page({ - data: { - loading: false, - list: [], - total: 0, - status: 'PENDING', - statusOptions: STATUS_OPTIONS, - canAudit: false - }, - - onShow() { - if (!navigation.ensureLogin('进入售后处理')) { - return - } - const permissionCodes = getApp().globalData.permissionCodes || [] - this.setData({ - canAudit: permission.hasPermission(permissionCodes, 'after_sale:audit') - }) - this.loadAfterSales() - }, - - onPullDownRefresh() { - this.loadAfterSales().finally(() => { - wx.stopPullDownRefresh() - }) - }, - - async loadAfterSales() { - this.setData({ loading: true }) - try { - const response = await afterSaleApi.listAfterSales({ - page: 1, - size: 20, - status: this.data.status || undefined - }) - this.setData({ - list: safeList(response).map(item => this.formatAfterSale(item)), - total: Number(response && response.total) || 0 - }) - } catch (error) { - wx.showToast({ - title: error.message || '售后加载失败', - icon: 'none' - }) - } finally { - this.setData({ loading: false }) - } - }, - - formatAfterSale(item) { - return { - ...item, - displayCreateTime: format.formatDateTime(item.createTime), - displayAuditTime: format.formatDateTime(item.auditTime), - displayRefundAmount: format.formatPrice(item.refundAmount), - statusText: statusText(item.status) - } - }, - - handleStatusChange(event) { - this.setData({ - status: event.currentTarget.dataset.status || '' - }) - this.loadAfterSales() - }, - - promptReason(title) { - return new Promise(resolve => { - wx.showModal({ - title, - content: '可填写处理说明,留空也可以提交。', - editable: true, - placeholderText: '处理说明', - confirmText: '提交', - success: result => { - if (!result.confirm) { - resolve(null) - return - } - resolve(String(result.content || '').trim()) - }, - fail: () => resolve(null) - }) - }) - }, - - async handleAudit(event) { - if (!this.data.canAudit) { - wx.showToast({ - title: '当前账号没有处理售后权限', - icon: 'none' - }) - return - } - const id = event.currentTarget.dataset.id - const action = event.currentTarget.dataset.action - if (!id || !action) { - return - } - const reason = await this.promptReason(action === 'approve' ? '同意售后' : '驳回售后') - if (reason === null) { - return - } - try { - const data = { - auditReason: reason - } - if (action === 'approve') { - await afterSaleApi.approveAfterSale(id, data) - } else { - await afterSaleApi.rejectAfterSale(id, data) - } - markDirty('admin-workbench') - wx.showToast({ - title: '售后已处理', - icon: 'none' - }) - this.loadAfterSales() - } catch (error) { - wx.showToast({ - title: error.message || '售后处理失败', - icon: 'none' - }) - } - }, - - handleBack() { - navigation.goBack('/pages/manage/index') - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/after-sales/index.json b/FD-WeChat-Fronted/admin/pages/after-sales/index.json deleted file mode 100644 index 696ffd1c..00000000 --- a/FD-WeChat-Fronted/admin/pages/after-sales/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - }, - "enablePullDownRefresh": true -} diff --git a/FD-WeChat-Fronted/admin/pages/after-sales/index.wxml b/FD-WeChat-Fronted/admin/pages/after-sales/index.wxml deleted file mode 100644 index d66a0eb0..00000000 --- a/FD-WeChat-Fronted/admin/pages/after-sales/index.wxml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - After Sale - 售后处理 - 查看待处理退款/售后申请,在手机端完成同意或驳回的最小闭环。 - - - - 状态筛选 - - - {{item.label}} - - - 共 {{total}} 条记录 - - - - - - - {{item.afterSaleNo || ('售后 #' + item.id)}} - 订单 {{item.orderId || '--'}} · {{item.displayCreateTime || '--'}} - - {{item.statusText}} - - - - 类型 - {{item.type || '--'}} - - - 退款金额 - ¥{{item.displayRefundAmount}} - - - 用户 ID - {{item.userId || '--'}} - - - 审核时间 - {{item.displayAuditTime || '--'}} - - - {{item.reason}} - 处理说明:{{item.auditReason}} - - 同意 - 驳回 - - - - - - 暂无售后单 - 当前状态下没有需要展示的售后记录。 - - - diff --git a/FD-WeChat-Fronted/admin/pages/after-sales/index.wxss b/FD-WeChat-Fronted/admin/pages/after-sales/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/after-sales/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/artist-form/index.js b/FD-WeChat-Fronted/admin/pages/artist-form/index.js deleted file mode 100644 index 3c90e614..00000000 --- a/FD-WeChat-Fronted/admin/pages/artist-form/index.js +++ /dev/null @@ -1,728 +0,0 @@ -/** - * Purpose: artistApi supports index.js by holding or executing the artist api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const artistApi = require('../../api/nail-artist') -/** - * Purpose: userApi supports index.js by holding or executing the user api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const userApi = require('../../api/user') -/** - * Purpose: tagApi supports index.js by holding or executing the tag api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const tagApi = require('../../api/tag') -/** - * Purpose: productApi supports index.js by holding or executing the product api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const productApi = require('../../api/product') -/** - * Purpose: shopApi supports index.js by holding or executing the shop api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const shopApi = require('../../api/shop') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: format supports index.js by holding or executing the format page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const format = require('../../utils/format') -const { getTempRecord, clearTempRecord } = require('../../utils/storage') - -/** - * Purpose: normalizeId supports index.js by holding or executing the normalize id page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function normalizeId(value) { - return value === undefined || value === null ? '' : String(value) -} - -/** - * Purpose: buildCheckableList supports index.js by holding or executing the build checkable list page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildCheckableList(list, selectedIds, labelKey) { - return (Array.isArray(list) ? list : []).map(item => ({ - ...item, - valueId: normalizeId(item.id), - labelText: item[labelKey], - checked: selectedIds.includes(normalizeId(item.id)) - })) -} - -/** - * Purpose: syncSelectedIds supports index.js by holding or executing the sync selected ids page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function syncSelectedIds(selectedIds, list) { - const availableIds = new Set((Array.isArray(list) ? list : []).map(item => normalizeId(item.id))) - return (Array.isArray(selectedIds) ? selectedIds : []).filter(id => availableIds.has(normalizeId(id))) -} - -/** - * Purpose: filterProductsByShop supports index.js by holding or executing the filter products by shop page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function filterProductsByShop(products, shopId) { - const targetShopId = normalizeId(shopId) - if (!targetShopId) { - return [] - } - - return (Array.isArray(products) ? products : []).filter(item => normalizeId(item.shopId) === targetShopId) -} - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create', - /** - * Purpose: userId supports index.js by holding or executing the user id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userId: '', - /** - * Purpose: shops supports index.js by holding or executing the shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shops: [], - /** - * Purpose: shopIndex supports index.js by holding or executing the shop index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopIndex: 0, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: '', - /** - * Purpose: statusOptions supports index.js by holding or executing the status options page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - statusOptions: ['营业中', '休息中'], - /** - * Purpose: statusIndex supports index.js by holding or executing the status index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - statusIndex: 0, - /** - * Purpose: userForm supports index.js by holding or executing the user form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userForm: { - /** - * Purpose: nickname supports index.js by holding or executing the nickname page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - nickname: '', - /** - * Purpose: account supports index.js by holding or executing the account page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - account: '', - /** - * Purpose: phone supports index.js by holding or executing the phone page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - phone: '', - /** - * Purpose: password supports index.js by holding or executing the password page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - password: '', - /** - * Purpose: signature supports index.js by holding or executing the signature page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - signature: '' - }, - /** - * Purpose: artistForm supports index.js by holding or executing the artist form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - artistForm: { - /** - * Purpose: identity supports index.js by holding or executing the identity page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - identity: '', - /** - * Purpose: experience supports index.js by holding or executing the experience page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - experience: '', - /** - * Purpose: rating supports index.js by holding or executing the rating page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - rating: '', - /** - * Purpose: portfolioText supports index.js by holding or executing the portfolio text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - portfolioText: '' - }, - /** - * Purpose: tags supports index.js by holding or executing the tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tags: [], - /** - * Purpose: products supports index.js by holding or executing the products page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - products: [] - }, - - /** - * Purpose: onLoad supports index.js by holding or executing the on load page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onLoad(options) { - const mode = options && options.mode ? options.mode : 'create' - const currentArtist = getTempRecord('currentArtist', null) - this.setData({ - mode, - /** - * Purpose: userId supports index.js by holding or executing the user id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userId: options && options.userId ? options.userId : '' - }) - - this._selectedTagIds = [] - this._selectedProductIds = [] - this._allProducts = [] - - if (mode === 'edit' && currentArtist) { - this._selectedTagIds = format.splitCsv(currentArtist.skills) - this._selectedProductIds = format.splitCsv(currentArtist.portfolio) - this._initialShopId = currentArtist.shopId - this.setData({ - /** - * Purpose: artistForm supports index.js by holding or executing the artist form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - artistForm: { - /** - * Purpose: identity supports index.js by holding or executing the identity page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - identity: currentArtist.identity || '', - /** - * Purpose: experience supports index.js by holding or executing the experience page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - experience: currentArtist.experience || '', - /** - * Purpose: rating supports index.js by holding or executing the rating page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - rating: currentArtist.rating || '', - /** - * Purpose: portfolioText supports index.js by holding or executing the portfolio text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - portfolioText: '' - }, - /** - * Purpose: userForm supports index.js by holding or executing the user form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userForm: { - /** - * Purpose: nickname supports index.js by holding or executing the nickname page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - nickname: currentArtist.nickname || '', - /** - * Purpose: account supports index.js by holding or executing the account page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - account: '', - /** - * Purpose: phone supports index.js by holding or executing the phone page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - phone: '', - /** - * Purpose: password supports index.js by holding or executing the password page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - password: '', - /** - * Purpose: signature supports index.js by holding or executing the signature page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - signature: currentArtist.signature || '' - }, - /** - * Purpose: statusIndex supports index.js by holding or executing the status index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - statusIndex: Number(currentArtist.status) === 0 ? 1 : 0 - }) - } - - this.loadDependencies() - }, - - /** - * Purpose: onUnload supports index.js by holding or executing the on unload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onUnload() { - clearTempRecord('currentArtist') - }, - - async loadDependencies() { - const app = getApp() - const currentShop = app.globalData.currentShop - const operator = app.globalData.userInfo || {} - - try { - const [shops, products, users] = await Promise.all([ - shopApi.listAllShops(), - productApi.listAllProducts(), - userApi.listAllUsers() - ]) - - let availableShops = Array.isArray(shops) ? shops : [] - if (Number(operator.type) !== 4 && currentShop) { - availableShops = availableShops.filter(item => normalizeId(item.id) === normalizeId(currentShop.id)) - } - - let shopIndex = 0 - if (this._initialShopId) { - const index = availableShops.findIndex(item => normalizeId(item.id) === normalizeId(this._initialShopId)) - if (index >= 0) { - shopIndex = index - } - } - const selectedShop = availableShops[shopIndex] - this._allProducts = Array.isArray(products) ? products : [] - - if (this.data.mode === 'edit') { - const userRecord = (Array.isArray(users) ? users : []).find(item => normalizeId(item.id) === normalizeId(this.data.userId)) - if (userRecord) { - this.setData({ - /** - * Purpose: userForm supports index.js by holding or executing the user form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userForm: { - /** - * Purpose: nickname supports index.js by holding or executing the nickname page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - nickname: userRecord.nickname || '', - /** - * Purpose: account supports index.js by holding or executing the account page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - account: userRecord.account || '', - /** - * Purpose: phone supports index.js by holding or executing the phone page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - phone: userRecord.phone || '', - /** - * Purpose: password supports index.js by holding or executing the password page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - password: '', - /** - * Purpose: signature supports index.js by holding or executing the signature page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - signature: userRecord.signature || '' - } - }) - } - } - - this.setData({ - /** - * Purpose: shops supports index.js by holding or executing the shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shops: availableShops, - shopIndex, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: selectedShop ? selectedShop.shopName : '' - }) - - await this.loadShopScopedOptions(selectedShop ? selectedShop.id : '') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '初始化美甲师表单失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - async loadShopScopedOptions(shopId) { - if (!normalizeId(shopId)) { - this._selectedTagIds = [] - this._selectedProductIds = [] - this.setData({ - /** - * Purpose: tags supports index.js by holding or executing the tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tags: [], - /** - * Purpose: products supports index.js by holding or executing the products page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - products: [] - }) - return - } - - try { - const tagList = await tagApi.listTagsByShopId(shopId) - const productList = filterProductsByShop(this._allProducts, shopId) - this._selectedTagIds = syncSelectedIds(this._selectedTagIds, tagList) - this._selectedProductIds = syncSelectedIds(this._selectedProductIds, productList) - this.setData({ - /** - * Purpose: tags supports index.js by holding or executing the tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tags: buildCheckableList(tagList, this._selectedTagIds, 'tagName'), - /** - * Purpose: products supports index.js by holding or executing the products page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - products: buildCheckableList(productList, this._selectedProductIds, 'title') - }) - } catch (error) { - this.setData({ - /** - * Purpose: tags supports index.js by holding or executing the tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tags: [], - /** - * Purpose: products supports index.js by holding or executing the products page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - products: [] - }) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '店铺关联数据加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleUserInput supports index.js by holding or executing the handle user input page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleUserInput(event) { - const field = event.currentTarget.dataset.field - let value = event.detail.value - - if (field === 'account') { - value = String(value || '').replace(/[^A-Za-z0-9]/g, '') - } - if (field === 'phone') { - value = String(value || '').replace(/[^\d]/g, '').slice(0, 11) - } - - this.setData({ - [`userForm.${field}`]: value - }) - }, - - /** - * Purpose: handleArtistInput supports index.js by holding or executing the handle artist input page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleArtistInput(event) { - const field = event.currentTarget.dataset.field - this.setData({ - [`artistForm.${field}`]: event.detail.value - }) - }, - - /** - * Purpose: handleShopChange supports index.js by holding or executing the handle shop change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleShopChange(event) { - const shopIndex = Number(event.detail.value) - const selectedShop = this.data.shops[shopIndex] - this.setData({ - shopIndex, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: selectedShop ? selectedShop.shopName : '' - }) - this.loadShopScopedOptions(selectedShop ? selectedShop.id : '') - }, - - /** - * Purpose: handleStatusChange supports index.js by holding or executing the handle status change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleStatusChange(event) { - this.setData({ - /** - * Purpose: statusIndex supports index.js by holding or executing the status index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - statusIndex: Number(event.detail.value) - }) - }, - - /** - * Purpose: handleTagChange supports index.js by holding or executing the handle tag change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleTagChange(event) { - this._selectedTagIds = event.detail.value || [] - this.setData({ - /** - * Purpose: tags supports index.js by holding or executing the tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tags: this.data.tags.map(item => ({ - ...item, - /** - * Purpose: checked supports index.js by holding or executing the checked page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - checked: this._selectedTagIds.includes(item.valueId) - })) - }) - }, - - /** - * Purpose: handleProductChange supports index.js by holding or executing the handle product change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleProductChange(event) { - this._selectedProductIds = event.detail.value || [] - this.setData({ - /** - * Purpose: products supports index.js by holding or executing the products page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - products: this.data.products.map(item => ({ - ...item, - /** - * Purpose: checked supports index.js by holding or executing the checked page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - checked: this._selectedProductIds.includes(item.valueId) - })) - }) - }, - - /** - * Purpose: validateForm supports index.js by holding or executing the validate form page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - validateForm() { - if (!this.data.userForm.nickname) { - return '请输入美甲师昵称' - } - if (!this.data.userForm.account) { - return '请输入账号' - } - if (!this.data.userForm.phone || this.data.userForm.phone.length !== 11) { - return '请输入 11 位手机号' - } - if (this.data.mode === 'create' && !this.data.userForm.password) { - return '新增美甲师时必须设置密码' - } - if (!this.data.shops[this.data.shopIndex]) { - return '请选择所属店铺' - } - return '' - }, - - async handleSubmit() { - const errorMessage = this.validateForm() - if (errorMessage) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: errorMessage, - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - - const selectedShop = this.data.shops[this.data.shopIndex] - const userPayload = { - /** - * Purpose: nickname supports index.js by holding or executing the nickname page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - nickname: this.data.userForm.nickname, - /** - * Purpose: account supports index.js by holding or executing the account page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - account: this.data.userForm.account, - /** - * Purpose: phone supports index.js by holding or executing the phone page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - phone: this.data.userForm.phone, - /** - * Purpose: signature supports index.js by holding or executing the signature page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - signature: this.data.userForm.signature || undefined, - /** - * Purpose: type supports index.js by holding or executing the type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - type: 3, - /** - * Purpose: shopIds supports index.js by holding or executing the shop ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopIds: selectedShop ? [Number(selectedShop.id)] : [] - } - - if (this.data.userForm.password) { - userPayload.password = this.data.userForm.password - } - - try { - let targetUserId = this.data.userId - if (this.data.mode === 'edit') { - await userApi.updateUser(targetUserId, userPayload) - } else { - targetUserId = await userApi.createUser(userPayload) - } - - await artistApi.saveNailArtistInfo({ - /** - * Purpose: userId supports index.js by holding or executing the user id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userId: Number(targetUserId), - /** - * Purpose: identity supports index.js by holding or executing the identity page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - identity: this.data.artistForm.identity || undefined, - /** - * Purpose: experience supports index.js by holding or executing the experience page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - experience: this.data.artistForm.experience ? Number(this.data.artistForm.experience) : 0, - /** - * Purpose: skills supports index.js by holding or executing the skills page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - skills: this._selectedTagIds.join(',') || undefined, - /** - * Purpose: rating supports index.js by holding or executing the rating page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - rating: this.data.artistForm.rating ? Number(this.data.artistForm.rating) : 0, - /** - * Purpose: status supports index.js by holding or executing the status page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - status: this.data.statusIndex === 1 ? 0 : 1, - /** - * Purpose: portfolio supports index.js by holding or executing the portfolio page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - portfolio: this._selectedProductIds.join(',') || undefined, - /** - * Purpose: nickname supports index.js by holding or executing the nickname page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - nickname: this.data.userForm.nickname, - /** - * Purpose: shopId supports index.js by holding or executing the shop id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopId: selectedShop ? Number(selectedShop.id) : undefined, - /** - * Purpose: signature supports index.js by holding or executing the signature page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - signature: this.data.userForm.signature || undefined - }) - - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: this.data.mode === 'edit' ? '美甲师已更新' : '美甲师已创建', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - navigation.goBack('/pages/artists/index') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '保存失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/artist-form/index.json b/FD-WeChat-Fronted/admin/pages/artist-form/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/artist-form/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/artist-form/index.wxml b/FD-WeChat-Fronted/admin/pages/artist-form/index.wxml deleted file mode 100644 index de152935..00000000 --- a/FD-WeChat-Fronted/admin/pages/artist-form/index.wxml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - 账号信息 - - 昵称 - - - - 账号 - - - - 手机号 - - - - {{mode === 'edit' ? '密码(留空则不修改)' : '登录密码'}} - - - - 签名 - - - - 所属店铺 - - {{shopLabel || '请选择店铺'}} - - - - - - 职业信息 - - 身份标签 - - - - 从业年限 - - - - 评分 - - - - 营业状态 - - {{statusOptions[statusIndex]}} - - - - 擅长标签 - - - - - - - - 作品集 - - - - - - - - - - - - diff --git a/FD-WeChat-Fronted/admin/pages/artist-form/index.wxss b/FD-WeChat-Fronted/admin/pages/artist-form/index.wxss deleted file mode 100644 index c7f2860b..00000000 --- a/FD-WeChat-Fronted/admin/pages/artist-form/index.wxss +++ /dev/null @@ -1,5 +0,0 @@ -@import "../../app.wxss"; -checkbox { - transform: scale(0.75); - margin-right: 8rpx; -} diff --git a/FD-WeChat-Fronted/admin/pages/artists/index.js b/FD-WeChat-Fronted/admin/pages/artists/index.js deleted file mode 100644 index 09cea75e..00000000 --- a/FD-WeChat-Fronted/admin/pages/artists/index.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Purpose: artistApi supports index.js by holding or executing the artist api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const artistApi = require('../../api/nail-artist') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -const { setTempRecord, clearTempRecord } = require('../../utils/storage') - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: [], - /** - * Purpose: canCreate supports index.js by holding or executing the can create page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canCreate: false - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入美甲师管理')) { - return - } - - const permissionCodes = getApp().globalData.permissionCodes || [] - this.setData({ - /** - * Purpose: canCreate supports index.js by holding or executing the can create page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canCreate: permissionCodes.includes('user:create') || permissionCodes.includes('nail_artist:edit') - }) - this.loadArtists() - }, - - async loadArtists() { - try { - const list = await artistApi.listNailArtists() - this.setData({ - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: (Array.isArray(list) ? list : []).map(item => ({ - ...item, - /** - * Purpose: displayStatusText supports index.js by holding or executing the display status text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayStatusText: Number(item.status) === 0 ? '休息中' : '营业中' - })) - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '美甲师列表加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleCreate supports index.js by holding or executing the handle create page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleCreate() { - clearTempRecord('currentArtist') - navigation.navigate('/pages/artist-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create' - }).catch(() => undefined) - }, - - /** - * Purpose: handleEdit supports index.js by holding or executing the handle edit page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleEdit(event) { - const artist = event.currentTarget.dataset.artist - setTempRecord('currentArtist', artist) - navigation.navigate('/pages/artist-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'edit', - /** - * Purpose: userId supports index.js by holding or executing the user id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userId: artist.userId - }).catch(() => undefined) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/artists/index.json b/FD-WeChat-Fronted/admin/pages/artists/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/artists/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/artists/index.wxml b/FD-WeChat-Fronted/admin/pages/artists/index.wxml deleted file mode 100644 index 304b40c6..00000000 --- a/FD-WeChat-Fronted/admin/pages/artists/index.wxml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 美甲师列表 - 店长只能看到并管理自己门店的美甲师;平台管理员可跨店查看,移动端表单集中处理账号和档案两部分信息。 - - - - - - - {{item.nickname}} - {{item.identity || '未设置身份'}} · {{item.shopName || '当前店铺'}} - - {{item.displayStatusText}} - - - - 从业年限 - {{item.experience || 0}} 年 - - - 评分 - {{item.rating || 0}} - - - - 编辑 - - - - - - 还没有美甲师 - 可以先新增一个美甲师账号,再补充技能、作品集和营业状态。 - - - + - - diff --git a/FD-WeChat-Fronted/admin/pages/artists/index.wxss b/FD-WeChat-Fronted/admin/pages/artists/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/artists/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/campaigns/index.js b/FD-WeChat-Fronted/admin/pages/campaigns/index.js deleted file mode 100644 index 5edf0392..00000000 --- a/FD-WeChat-Fronted/admin/pages/campaigns/index.js +++ /dev/null @@ -1,154 +0,0 @@ -const campaignApi = require('../../api/campaign') -const navigation = require('../../utils/navigation') -const permission = require('../../utils/permission') -const format = require('../../utils/format') -const { markDirty } = require('../../utils/page-state') - -const STATUS_OPTIONS = [ - { label: '全部', value: '' }, - { label: '启用', value: '1' }, - { label: '停用', value: '0' } -] - -function safeList(response) { - if (Array.isArray(response && response.list)) { - return response.list - } - if (Array.isArray(response && response.records)) { - return response.records - } - return [] -} - -Page({ - data: { - loading: false, - list: [], - total: 0, - status: '', - statusOptions: STATUS_OPTIONS, - canManage: false, - form: { - title: '', - scene: 'HOME', - description: '', - sortOrder: '0' - } - }, - - onShow() { - if (!navigation.ensureLogin('进入活动管理')) { - return - } - const permissionCodes = getApp().globalData.permissionCodes || [] - this.setData({ - canManage: permission.hasPermission(permissionCodes, 'campaign:manage') - }) - this.loadCampaigns() - }, - - onPullDownRefresh() { - this.loadCampaigns().finally(() => { - wx.stopPullDownRefresh() - }) - }, - - async loadCampaigns() { - this.setData({ loading: true }) - try { - const response = await campaignApi.listCampaigns({ - page: 1, - size: 20, - status: this.data.status === '' ? undefined : Number(this.data.status) - }) - this.setData({ - list: safeList(response).map(item => this.formatCampaign(item)), - total: Number(response && response.total) || 0 - }) - } catch (error) { - wx.showToast({ - title: error.message || '活动加载失败', - icon: 'none' - }) - } finally { - this.setData({ loading: false }) - } - }, - - formatCampaign(item) { - return { - ...item, - statusText: Number(item.status) === 0 ? '停用' : '启用', - displayStartTime: format.formatDateTime(item.startTime), - displayEndTime: format.formatDateTime(item.endTime) - } - }, - - handleStatusChange(event) { - this.setData({ - status: event.currentTarget.dataset.status - }) - this.loadCampaigns() - }, - - handleFormInput(event) { - const field = event.currentTarget.dataset.field - if (!field) { - return - } - this.setData({ - [`form.${field}`]: event.detail.value - }) - }, - - async handleSaveCampaign() { - if (!this.data.canManage) { - wx.showToast({ - title: '当前账号没有活动管理权限', - icon: 'none' - }) - return - } - const form = this.data.form - const title = String(form.title || '').trim() - if (!title) { - wx.showToast({ - title: '请填写活动标题', - icon: 'none' - }) - return - } - try { - await campaignApi.saveCampaign({ - title, - scene: String(form.scene || '').trim() || 'HOME', - description: String(form.description || '').trim(), - sortOrder: Number(form.sortOrder) || 0, - status: 1 - }) - markDirty('admin-workbench') - wx.showToast({ - title: '活动已创建', - icon: 'none' - }) - this.setData({ - form: { - title: '', - scene: 'HOME', - description: '', - sortOrder: '0' - } - }) - this.loadCampaigns() - } catch (error) { - wx.showToast({ - title: error.message || '活动保存失败', - icon: 'none' - }) - } - }, - - handleBack() { - navigation.goBack('/pages/manage/index') - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/campaigns/index.json b/FD-WeChat-Fronted/admin/pages/campaigns/index.json deleted file mode 100644 index 696ffd1c..00000000 --- a/FD-WeChat-Fronted/admin/pages/campaigns/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - }, - "enablePullDownRefresh": true -} diff --git a/FD-WeChat-Fronted/admin/pages/campaigns/index.wxml b/FD-WeChat-Fronted/admin/pages/campaigns/index.wxml deleted file mode 100644 index 7cce4740..00000000 --- a/FD-WeChat-Fronted/admin/pages/campaigns/index.wxml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - Campaign - 活动管理 - 查看营销活动和推荐位配置,支持在手机端快速创建启用活动。 - - - - 快速创建 - - - - - - - - - - - 活动列表 - - - {{item.label}} - - - 共 {{total}} 条活动 - - - - - - - {{item.title}} - {{item.scene || '未设置场景'}} · 排序 {{item.sortOrder || 0}} - - {{item.statusText}} - - {{item.description}} - - - 开始 - {{item.displayStartTime || '--'}} - - - 结束 - {{item.displayEndTime || '--'}} - - - - - - - 暂无活动 - 当前筛选条件下没有营销活动。 - - - diff --git a/FD-WeChat-Fronted/admin/pages/campaigns/index.wxss b/FD-WeChat-Fronted/admin/pages/campaigns/index.wxss deleted file mode 100644 index 1cff8524..00000000 --- a/FD-WeChat-Fronted/admin/pages/campaigns/index.wxss +++ /dev/null @@ -1,21 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} - -.compact-field, -.compact-btn, -.compact-textarea { - margin-top: 16rpx; -} - -.form-grid { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 14rpx; - margin-top: 16rpx; -} - -.compact-textarea { - min-height: 140rpx; -} diff --git a/FD-WeChat-Fronted/admin/pages/comments/index.js b/FD-WeChat-Fronted/admin/pages/comments/index.js deleted file mode 100644 index 88e15779..00000000 --- a/FD-WeChat-Fronted/admin/pages/comments/index.js +++ /dev/null @@ -1,143 +0,0 @@ -/** - * Purpose: commentApi supports index.js by holding or executing the comment api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const commentApi = require('../../api/comment') - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false, - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: '', - /** - * Purpose: comments supports index.js by holding or executing the comments page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - comments: [] - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - this.loadComments() - }, - - async onPullDownRefresh() { - await this.loadComments() - wx.stopPullDownRefresh() - }, - - /** - * Purpose: handleKeywordInput supports index.js by holding or executing the handle keyword input page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleKeywordInput(event) { - this.setData({ - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: event.detail.value - }) - }, - - async loadComments() { - this.setData({ loading: true }) - try { - const comments = await commentApi.listComments({ - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: this.data.keyword || undefined - }) - this.setData({ - /** - * Purpose: comments supports index.js by holding or executing the comments page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - comments: Array.isArray(comments) ? comments : [] - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '评论加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } finally { - this.setData({ loading: false }) - } - }, - - /** - * Purpose: handleSearch supports index.js by holding or executing the handle search page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleSearch() { - this.loadComments() - }, - - /** - * Purpose: handleDelete supports index.js by holding or executing the handle delete page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleDelete(event) { - const id = event.currentTarget.dataset.id - if (!id) { - return - } - wx.showModal({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '删除评论', - /** - * Purpose: content supports index.js by holding or executing the content page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - content: '确认删除这条评论?', - /** - * Purpose: confirmText supports index.js by holding or executing the confirm text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - confirmText: '删除', - /** - * Purpose: success supports index.js by holding or executing the success page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - success: async res => { - if (!res.confirm) { - return - } - try { - await commentApi.deleteComment(id) - wx.showToast({ title: '评论已删除', icon: 'none' }) - this.loadComments() - } catch (error) { - wx.showToast({ title: error.message || '删除失败', icon: 'none' }) - } - } - }) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/comments/index.json b/FD-WeChat-Fronted/admin/pages/comments/index.json deleted file mode 100644 index 0967ef42..00000000 --- a/FD-WeChat-Fronted/admin/pages/comments/index.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/FD-WeChat-Fronted/admin/pages/comments/index.wxml b/FD-WeChat-Fronted/admin/pages/comments/index.wxml deleted file mode 100644 index 2b8190e6..00000000 --- a/FD-WeChat-Fronted/admin/pages/comments/index.wxml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - 搜索 - - - 暂无评论 - - - - {{item.userNickname || '用户'}} - {{item.createTime}} - - {{item.commentContent}} - 回复:{{item.parentCommentContent}} - {{item.productTitle || '作品'}} · {{item.shopName || '门店'}} - 删除 - - diff --git a/FD-WeChat-Fronted/admin/pages/comments/index.wxss b/FD-WeChat-Fronted/admin/pages/comments/index.wxss deleted file mode 100644 index 61322180..00000000 --- a/FD-WeChat-Fronted/admin/pages/comments/index.wxss +++ /dev/null @@ -1,95 +0,0 @@ -@import "../../app.wxss"; -.page { - min-height: 100vh; - padding: 28rpx 24rpx 60rpx; - background: #0c181b; -} - -.search-row { - display: flex; - gap: 16rpx; - margin-bottom: 24rpx; -} - -.search-input { - flex: 1; - height: 76rpx; - padding: 0 24rpx; - border-radius: 18rpx; - background: #132529; - color: #ffffff; - font-size: 26rpx; -} - -.search-btn { - width: 128rpx; - height: 76rpx; - line-height: 76rpx; - text-align: center; - border-radius: 18rpx; - background: #f07e57; - color: #ffffff; - font-weight: 700; -} - -.empty { - padding: 80rpx 0; - text-align: center; - color: #7e8f8c; -} - -.comment-card { - margin-bottom: 18rpx; - padding: 24rpx; - border-radius: 20rpx; - background: #132529; - color: #dce7e4; -} - -.comment-head { - display: flex; - justify-content: space-between; - gap: 16rpx; -} - -.comment-user { - font-size: 28rpx; - font-weight: 700; - color: #ffffff; -} - -.comment-time, -.comment-meta { - font-size: 22rpx; - color: #7e8f8c; -} - -.comment-content { - margin-top: 16rpx; - font-size: 26rpx; - line-height: 1.8; -} - -.reply-content { - margin-top: 12rpx; - padding: 16rpx; - border-radius: 16rpx; - background: #0c181b; - color: #a9bbb6; - font-size: 24rpx; -} - -.comment-meta { - margin-top: 14rpx; -} - -.delete-btn { - margin-top: 18rpx; - width: 120rpx; - height: 56rpx; - line-height: 56rpx; - text-align: center; - border-radius: 999rpx; - color: #ffffff; - background: #d95f5f; -} diff --git a/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.js b/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.js deleted file mode 100644 index d8da2343..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.js +++ /dev/null @@ -1,87 +0,0 @@ -const couponApi = require('../../api/coupon') -const userApi = require('../../api/user') -const navigation = require('../../utils/navigation') -const { getTempRecord, clearTempRecord } = require('../../utils/storage') - -Page({ - data: { - coupon: null, - users: [], - quantity: 1 - }, - - onLoad() { - const coupon = getTempRecord('currentCoupon', null) - this.setData({ - coupon - }) - this.loadUsers() - }, - - onUnload() { - clearTempRecord('currentCoupon') - }, - - async loadUsers() { - try { - const users = await userApi.listAllUsers() - this.setData({ - users: (Array.isArray(users) ? users : []).map(item => ({ - ...item, - valueId: String(item.id), - checked: false - })) - }) - } catch (error) { - wx.showToast({ - title: error.message || '可发放用户加载失败', - icon: 'none' - }) - } - }, - - handleUserCheck(event) { - const selected = event.detail.value || [] - this.setData({ - users: this.data.users.map(item => ({ - ...item, - checked: selected.includes(item.valueId) - })) - }) - }, - - handleQuantityInput(event) { - this.setData({ - quantity: event.detail.value - }) - }, - - async handleSubmit() { - const selectedUserIds = this.data.users.filter(item => item.checked).map(item => Number(item.id)) - if (!selectedUserIds.length) { - wx.showToast({ - title: '请至少选择一个用户', - icon: 'none' - }) - return - } - - try { - await couponApi.distributeCoupon({ - couponId: this.data.coupon.id, - userIds: selectedUserIds, - quantity: Number(this.data.quantity || 1) - }) - wx.showToast({ - title: '优惠券已发放', - icon: 'none' - }) - navigation.goBack('/pages/coupons/index') - } catch (error) { - wx.showToast({ - title: error.message || '发放失败', - icon: 'none' - }) - } - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.json b/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.wxml b/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.wxml deleted file mode 100644 index 99c31e7f..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.wxml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - {{coupon.couponName}} - 选择用户后批量发放,数量默认 1。移动端只保留高频发放能力,不把 Web 的宽表格搬过来。 - - 发放数量 - - - - 选择用户 - - - - - - - - - - - - diff --git a/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.wxss b/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.wxss deleted file mode 100644 index c7f2860b..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupon-distribute/index.wxss +++ /dev/null @@ -1,5 +0,0 @@ -@import "../../app.wxss"; -checkbox { - transform: scale(0.75); - margin-right: 8rpx; -} diff --git a/FD-WeChat-Fronted/admin/pages/coupon-form/index.js b/FD-WeChat-Fronted/admin/pages/coupon-form/index.js deleted file mode 100644 index 74dbc619..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupon-form/index.js +++ /dev/null @@ -1,707 +0,0 @@ -/** - * Purpose: couponApi supports index.js by holding or executing the coupon api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const couponApi = require('../../api/coupon') -/** - * Purpose: tagApi supports index.js by holding or executing the tag api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const tagApi = require('../../api/tag') -/** - * Purpose: shopApi supports index.js by holding or executing the shop api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const shopApi = require('../../api/shop') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: format supports index.js by holding or executing the format page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const format = require('../../utils/format') -const { getTempRecord, clearTempRecord } = require('../../utils/storage') - -/** - * Purpose: normalizeId supports index.js by holding or executing the normalize id page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function normalizeId(value) { - return value === undefined || value === null ? '' : String(value) -} - -/** - * Purpose: buildCheckableList supports index.js by holding or executing the build checkable list page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildCheckableList(list, selectedIds, labelKey) { - return (Array.isArray(list) ? list : []).map(item => ({ - ...item, - valueId: normalizeId(item.id), - labelText: item[labelKey], - checked: selectedIds.includes(normalizeId(item.id)) - })) -} - -/** - * Purpose: syncSelectedIds supports index.js by holding or executing the sync selected ids page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function syncSelectedIds(selectedIds, list) { - const availableIds = new Set((Array.isArray(list) ? list : []).map(item => normalizeId(item.id))) - return (Array.isArray(selectedIds) ? selectedIds : []).filter(id => availableIds.has(normalizeId(id))) -} - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create', - /** - * Purpose: couponId supports index.js by holding or executing the coupon id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponId: '', - /** - * Purpose: shops supports index.js by holding or executing the shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shops: [], - /** - * Purpose: shopIndex supports index.js by holding or executing the shop index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopIndex: 0, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: '', - /** - * Purpose: couponTypeOptions supports index.js by holding or executing the coupon type options page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponTypeOptions: ['折扣券', '满减券'], - /** - * Purpose: couponTypeIndex supports index.js by holding or executing the coupon type index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponTypeIndex: 0, - /** - * Purpose: couponTypeLabel supports index.js by holding or executing the coupon type label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponTypeLabel: '折扣券', - /** - * Purpose: vipLevelOptions supports index.js by holding or executing the vip level options page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - vipLevelOptions: ['普通', '青铜', '白银', '黄金'], - /** - * Purpose: vipLevelIndex supports index.js by holding or executing the vip level index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - vipLevelIndex: 0, - /** - * Purpose: vipLevelLabel supports index.js by holding or executing the vip level label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - vipLevelLabel: '普通', - /** - * Purpose: startDate supports index.js by holding or executing the start date page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - startDate: '', - /** - * Purpose: startTime supports index.js by holding or executing the start time page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - startTime: '', - /** - * Purpose: endDate supports index.js by holding or executing the end date page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - endDate: '', - /** - * Purpose: endTime supports index.js by holding or executing the end time page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - endTime: '', - /** - * Purpose: availableTags supports index.js by holding or executing the available tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - availableTags: [], - /** - * Purpose: unavailableTags supports index.js by holding or executing the unavailable tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - unavailableTags: [], - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: couponName supports index.js by holding or executing the coupon name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponName: '', - /** - * Purpose: couponCode supports index.js by holding or executing the coupon code page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponCode: '', - /** - * Purpose: discountValue supports index.js by holding or executing the discount value page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - discountValue: '', - /** - * Purpose: minAmount supports index.js by holding or executing the min amount page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - minAmount: '', - /** - * Purpose: reduceAmount supports index.js by holding or executing the reduce amount page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - reduceAmount: '', - /** - * Purpose: totalCount supports index.js by holding or executing the total count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - totalCount: '', - /** - * Purpose: couponScene supports index.js by holding or executing the coupon scene page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponScene: '', - /** - * Purpose: autoMatch supports index.js by holding or executing the auto match page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - autoMatch: false - } - }, - - /** - * Purpose: onLoad supports index.js by holding or executing the on load page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onLoad(options) { - const mode = options && options.mode ? options.mode : 'create' - const currentCoupon = getTempRecord('currentCoupon', null) - this.setData({ - mode, - /** - * Purpose: couponId supports index.js by holding or executing the coupon id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponId: options && options.id ? options.id : '' - }) - - this._selectedAvailableTagIds = [] - this._selectedUnavailableTagIds = [] - - if (mode === 'edit' && currentCoupon) { - const start = format.parseDateTimeToPicker(currentCoupon.startTime) - const end = format.parseDateTimeToPicker(currentCoupon.endTime) - this._selectedAvailableTagIds = Array.isArray(currentCoupon.availableTags) ? currentCoupon.availableTags.map(item => String(item.id)) : [] - this._selectedUnavailableTagIds = Array.isArray(currentCoupon.unavailableTags) ? currentCoupon.unavailableTags.map(item => String(item.id)) : [] - this._initialShopId = currentCoupon.shopId - this.setData({ - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: couponName supports index.js by holding or executing the coupon name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponName: currentCoupon.couponName || '', - /** - * Purpose: couponCode supports index.js by holding or executing the coupon code page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponCode: currentCoupon.couponCode || '', - /** - * Purpose: discountValue supports index.js by holding or executing the discount value page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - discountValue: currentCoupon.discountValue || '', - /** - * Purpose: minAmount supports index.js by holding or executing the min amount page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - minAmount: currentCoupon.minAmount || '', - /** - * Purpose: reduceAmount supports index.js by holding or executing the reduce amount page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - reduceAmount: currentCoupon.reduceAmount || '', - /** - * Purpose: totalCount supports index.js by holding or executing the total count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - totalCount: currentCoupon.totalCount || '', - /** - * Purpose: couponScene supports index.js by holding or executing the coupon scene page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponScene: currentCoupon.couponScene || '', - /** - * Purpose: autoMatch supports index.js by holding or executing the auto match page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - autoMatch: Number(currentCoupon.autoMatch) === 1 - }, - /** - * Purpose: couponTypeIndex supports index.js by holding or executing the coupon type index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponTypeIndex: Number(currentCoupon.couponType) === 2 ? 1 : 0, - /** - * Purpose: couponTypeLabel supports index.js by holding or executing the coupon type label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponTypeLabel: Number(currentCoupon.couponType) === 2 ? '满减券' : '折扣券', - /** - * Purpose: vipLevelIndex supports index.js by holding or executing the vip level index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - vipLevelIndex: this.data.vipLevelOptions.findIndex(item => item === (currentCoupon.requiredVipLevel || '普通')), - /** - * Purpose: vipLevelLabel supports index.js by holding or executing the vip level label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - vipLevelLabel: currentCoupon.requiredVipLevel || '普通', - /** - * Purpose: startDate supports index.js by holding or executing the start date page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - startDate: start.date, - /** - * Purpose: startTime supports index.js by holding or executing the start time page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - startTime: start.time, - /** - * Purpose: endDate supports index.js by holding or executing the end date page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - endDate: end.date, - /** - * Purpose: endTime supports index.js by holding or executing the end time page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - endTime: end.time - }) - } - - this.loadDependencies() - }, - - /** - * Purpose: onUnload supports index.js by holding or executing the on unload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onUnload() { - clearTempRecord('currentCoupon') - }, - - async loadDependencies() { - const app = getApp() - const currentShop = app.globalData.currentShop - const operator = app.globalData.userInfo || {} - - try { - const shopList = await shopApi.listAllShops() - - let shops = Array.isArray(shopList) ? shopList : [] - if (Number(operator.type) !== 4 && currentShop) { - shops = shops.filter(item => normalizeId(item.id) === normalizeId(currentShop.id)) - } - - let shopIndex = 0 - if (this._initialShopId) { - const index = shops.findIndex(item => normalizeId(item.id) === normalizeId(this._initialShopId)) - if (index >= 0) { - shopIndex = index - } - } - const selectedShop = shops[shopIndex] - - this.setData({ - shops, - shopIndex, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: selectedShop ? selectedShop.shopName : '' - }) - - await this.loadTagOptions(selectedShop ? selectedShop.id : '') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '初始化优惠券表单失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - async loadTagOptions(shopId) { - if (!normalizeId(shopId)) { - this._selectedAvailableTagIds = [] - this._selectedUnavailableTagIds = [] - this.setData({ - /** - * Purpose: availableTags supports index.js by holding or executing the available tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - availableTags: [], - /** - * Purpose: unavailableTags supports index.js by holding or executing the unavailable tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - unavailableTags: [] - }) - return - } - - try { - const tagList = await tagApi.listTagsByShopId(shopId) - this._selectedAvailableTagIds = syncSelectedIds(this._selectedAvailableTagIds, tagList) - this._selectedUnavailableTagIds = syncSelectedIds(this._selectedUnavailableTagIds, tagList) - this.setData({ - /** - * Purpose: availableTags supports index.js by holding or executing the available tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - availableTags: buildCheckableList(tagList, this._selectedAvailableTagIds, 'tagName'), - /** - * Purpose: unavailableTags supports index.js by holding or executing the unavailable tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - unavailableTags: buildCheckableList(tagList, this._selectedUnavailableTagIds, 'tagName') - }) - } catch (error) { - this.setData({ - /** - * Purpose: availableTags supports index.js by holding or executing the available tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - availableTags: [], - /** - * Purpose: unavailableTags supports index.js by holding or executing the unavailable tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - unavailableTags: [] - }) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '可用标签加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleInputChange supports index.js by holding or executing the handle input change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleInputChange(event) { - const field = event.currentTarget.dataset.field - const value = event.detail.value - this.setData({ - [`form.${field}`]: value - }) - }, - - /** - * Purpose: handleShopChange supports index.js by holding or executing the handle shop change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleShopChange(event) { - const shopIndex = Number(event.detail.value) - const selectedShop = this.data.shops[shopIndex] - this.setData({ - shopIndex, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: selectedShop ? selectedShop.shopName : '' - }) - this.loadTagOptions(selectedShop ? selectedShop.id : '') - }, - - /** - * Purpose: handleCouponTypeChange supports index.js by holding or executing the handle coupon type change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleCouponTypeChange(event) { - const couponTypeIndex = Number(event.detail.value) - this.setData({ - couponTypeIndex, - /** - * Purpose: couponTypeLabel supports index.js by holding or executing the coupon type label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponTypeLabel: this.data.couponTypeOptions[couponTypeIndex] - }) - }, - - /** - * Purpose: handleVipLevelChange supports index.js by holding or executing the handle vip level change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleVipLevelChange(event) { - const vipLevelIndex = Number(event.detail.value) - this.setData({ - vipLevelIndex, - /** - * Purpose: vipLevelLabel supports index.js by holding or executing the vip level label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - vipLevelLabel: this.data.vipLevelOptions[vipLevelIndex] - }) - }, - - /** - * Purpose: handleDateTimeChange supports index.js by holding or executing the handle date time change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleDateTimeChange(event) { - const field = event.currentTarget.dataset.field - this.setData({ - [field]: event.detail.value - }) - }, - - /** - * Purpose: handleAutoMatchChange supports index.js by holding or executing the handle auto match change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleAutoMatchChange(event) { - this.setData({ - 'form.autoMatch': event.detail.value - }) - }, - - /** - * Purpose: handleAvailableTagChange supports index.js by holding or executing the handle available tag change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleAvailableTagChange(event) { - this._selectedAvailableTagIds = event.detail.value || [] - this.setData({ - /** - * Purpose: availableTags supports index.js by holding or executing the available tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - availableTags: this.data.availableTags.map(item => ({ - ...item, - /** - * Purpose: checked supports index.js by holding or executing the checked page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - checked: this._selectedAvailableTagIds.includes(item.valueId) - })) - }) - }, - - /** - * Purpose: handleUnavailableTagChange supports index.js by holding or executing the handle unavailable tag change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleUnavailableTagChange(event) { - this._selectedUnavailableTagIds = event.detail.value || [] - this.setData({ - /** - * Purpose: unavailableTags supports index.js by holding or executing the unavailable tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - unavailableTags: this.data.unavailableTags.map(item => ({ - ...item, - /** - * Purpose: checked supports index.js by holding or executing the checked page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - checked: this._selectedUnavailableTagIds.includes(item.valueId) - })) - }) - }, - - async handleSubmit() { - const selectedShop = this.data.shops[this.data.shopIndex] - if (!this.data.form.couponName) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '请输入优惠券名称', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - if (!selectedShop) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '请选择所属店铺', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - - const payload = { - /** - * Purpose: couponCode supports index.js by holding or executing the coupon code page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponCode: this.data.form.couponCode || undefined, - /** - * Purpose: couponName supports index.js by holding or executing the coupon name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponName: this.data.form.couponName, - /** - * Purpose: couponType supports index.js by holding or executing the coupon type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponType: this.data.couponTypeIndex === 1 ? 2 : 1, - /** - * Purpose: discountValue supports index.js by holding or executing the discount value page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - discountValue: this.data.couponTypeIndex === 0 ? Number(this.data.form.discountValue || 0) : undefined, - /** - * Purpose: minAmount supports index.js by holding or executing the min amount page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - minAmount: this.data.couponTypeIndex === 1 ? Number(this.data.form.minAmount || 0) : undefined, - /** - * Purpose: reduceAmount supports index.js by holding or executing the reduce amount page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - reduceAmount: this.data.couponTypeIndex === 1 ? Number(this.data.form.reduceAmount || 0) : undefined, - /** - * Purpose: totalCount supports index.js by holding or executing the total count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - totalCount: this.data.form.totalCount ? Number(this.data.form.totalCount) : undefined, - /** - * Purpose: startTime supports index.js by holding or executing the start time page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - startTime: format.buildDateTime(this.data.startDate, this.data.startTime), - /** - * Purpose: endTime supports index.js by holding or executing the end time page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - endTime: format.buildDateTime(this.data.endDate, this.data.endTime), - /** - * Purpose: shopId supports index.js by holding or executing the shop id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopId: selectedShop.id, - /** - * Purpose: couponScene supports index.js by holding or executing the coupon scene page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - couponScene: this.data.form.couponScene || undefined, - /** - * Purpose: requiredVipLevel supports index.js by holding or executing the required vip level page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - requiredVipLevel: this.data.vipLevelLabel || undefined, - /** - * Purpose: autoMatch supports index.js by holding or executing the auto match page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - autoMatch: this.data.form.autoMatch ? 1 : 0, - /** - * Purpose: availableTagIds supports index.js by holding or executing the available tag ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - availableTagIds: this._selectedAvailableTagIds.map(item => Number(item)), - /** - * Purpose: unavailableTagIds supports index.js by holding or executing the unavailable tag ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - unavailableTagIds: this._selectedUnavailableTagIds.map(item => Number(item)) - } - - try { - if (this.data.mode === 'edit') { - await couponApi.updateCoupon(this.data.couponId, payload) - } else { - await couponApi.createCoupon(payload) - } - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: this.data.mode === 'edit' ? '优惠券已更新' : '优惠券已创建', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - navigation.goBack('/pages/coupons/index') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '保存失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/coupon-form/index.json b/FD-WeChat-Fronted/admin/pages/coupon-form/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupon-form/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/coupon-form/index.wxml b/FD-WeChat-Fronted/admin/pages/coupon-form/index.wxml deleted file mode 100644 index 4be784a5..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupon-form/index.wxml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - 优惠券信息 - - 优惠券名称 - - - - 所属店铺 - - {{shopLabel || '请选择店铺'}} - - - - 券类型 - - {{couponTypeLabel}} - - - - 优惠编码 - - - - 折扣值 - - - - - 满多少可用 - - - - 减免金额 - - - - - 总数量 - - - - 优惠场景 - - - - VIP 等级限制 - - {{vipLevelLabel}} - - - - 开始日期 / 时间 - - - {{startDate || '开始日期'}} - - - {{startTime || '开始时间'}} - - - - - 结束日期 / 时间 - - - {{endDate || '结束日期'}} - - - {{endTime || '结束时间'}} - - - - - 自动匹配 - - - - - 可用标签 - - - - - - - - - 不可用标签 - - - - - - - - - - - - - diff --git a/FD-WeChat-Fronted/admin/pages/coupon-form/index.wxss b/FD-WeChat-Fronted/admin/pages/coupon-form/index.wxss deleted file mode 100644 index c7f2860b..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupon-form/index.wxss +++ /dev/null @@ -1,5 +0,0 @@ -@import "../../app.wxss"; -checkbox { - transform: scale(0.75); - margin-right: 8rpx; -} diff --git a/FD-WeChat-Fronted/admin/pages/coupons/index.js b/FD-WeChat-Fronted/admin/pages/coupons/index.js deleted file mode 100644 index 5465828d..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupons/index.js +++ /dev/null @@ -1,219 +0,0 @@ -/** - * Purpose: couponApi supports index.js by holding or executing the coupon api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const couponApi = require('../../api/coupon') -/** - * Purpose: format supports index.js by holding or executing the format page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const format = require('../../utils/format') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -const { setTempRecord, clearTempRecord } = require('../../utils/storage') - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: [], - /** - * Purpose: canCreate supports index.js by holding or executing the can create page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canCreate: false - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入优惠券管理')) { - return - } - - const permissionCodes = getApp().globalData.permissionCodes || [] - this.setData({ - /** - * Purpose: canCreate supports index.js by holding or executing the can create page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canCreate: permissionCodes.includes('coupon:create') - }) - this.loadCoupons() - }, - - async loadCoupons() { - try { - const result = await couponApi.listCoupons({ - /** - * Purpose: page supports index.js by holding or executing the page page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - page: 1, - /** - * Purpose: size supports index.js by holding or executing the size page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - size: 20 - }) - this.setData({ - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: (Array.isArray(result && result.list) ? result.list : []).map(item => ({ - ...item, - /** - * Purpose: displayTypeText supports index.js by holding or executing the display type text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayTypeText: format.getCouponTypeText(item.couponType), - /** - * Purpose: displayValueText supports index.js by holding or executing the display value text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayValueText: format.getCouponValueText(item), - /** - * Purpose: displayShopName supports index.js by holding or executing the display shop name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayShopName: item.shopName || '当前店铺' - })) - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '优惠券加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleCreate supports index.js by holding or executing the handle create page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleCreate() { - clearTempRecord('currentCoupon') - navigation.navigate('/pages/coupon-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create' - }).catch(() => undefined) - }, - - /** - * Purpose: handleEdit supports index.js by holding or executing the handle edit page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleEdit(event) { - const coupon = event.currentTarget.dataset.coupon - setTempRecord('currentCoupon', coupon) - navigation.navigate('/pages/coupon-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'edit', - /** - * Purpose: id supports index.js by holding or executing the id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - id: coupon.id - }).catch(() => undefined) - }, - - /** - * Purpose: handleDistribute supports index.js by holding or executing the handle distribute page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleDistribute(event) { - const coupon = event.currentTarget.dataset.coupon - setTempRecord('currentCoupon', coupon) - navigation.navigate('/pages/coupon-distribute/index', { - /** - * Purpose: id supports index.js by holding or executing the id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - id: coupon.id - }).catch(() => undefined) - }, - - /** - * Purpose: handleDelete supports index.js by holding or executing the handle delete page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleDelete(event) { - const coupon = event.currentTarget.dataset.coupon - wx.showModal({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '删除优惠券', - /** - * Purpose: content supports index.js by holding or executing the content page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - content: `确认删除优惠券“${coupon.couponName}”吗?`, - /** - * Purpose: success supports index.js by holding or executing the success page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - success: async result => { - if (!result.confirm) { - return - } - try { - await couponApi.deleteCoupon(coupon.id) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '优惠券已删除', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - this.loadCoupons() - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '优惠券删除失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } - }) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/coupons/index.json b/FD-WeChat-Fronted/admin/pages/coupons/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupons/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/coupons/index.wxml b/FD-WeChat-Fronted/admin/pages/coupons/index.wxml deleted file mode 100644 index 1c738ea0..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupons/index.wxml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 优惠券列表 - 普通券、VIP 自动券都在这里维护;发放动作单独收口到移动端发放页,避免一屏塞太多字段。 - - - - - - - {{item.couponName}} - {{item.displayShopName}} · {{item.displayTypeText}} - - {{item.displayValueText}} - - - - 可用时间 - {{item.startTime}} ~ {{item.endTime}} - - - 剩余数量 - {{item.remainingCount || item.totalCount || '--'}} - - - - 发放 - 编辑 - 删除 - - - - - - 暂无优惠券 - 可以先创建普通券,也可以为每家店铺维护自己的 VIP 自动券模板。 - - - + - - diff --git a/FD-WeChat-Fronted/admin/pages/coupons/index.wxss b/FD-WeChat-Fronted/admin/pages/coupons/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/coupons/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/inventory/index.js b/FD-WeChat-Fronted/admin/pages/inventory/index.js deleted file mode 100644 index d0741a91..00000000 --- a/FD-WeChat-Fronted/admin/pages/inventory/index.js +++ /dev/null @@ -1,204 +0,0 @@ -const inventoryApi = require('../../api/inventory') -const navigation = require('../../utils/navigation') -const permission = require('../../utils/permission') -const format = require('../../utils/format') -const { markDirty } = require('../../utils/page-state') - -function safeList(response) { - if (Array.isArray(response && response.list)) { - return response.list - } - if (Array.isArray(response && response.records)) { - return response.records - } - return [] -} - -Page({ - data: { - loading: false, - list: [], - total: 0, - canManage: false, - form: { - itemName: '', - category: '', - unit: '件', - stockQuantity: '0', - warningThreshold: '1' - } - }, - - onShow() { - if (!navigation.ensureLogin('进入库存管理')) { - return - } - const permissionCodes = getApp().globalData.permissionCodes || [] - this.setData({ - canManage: permission.hasPermission(permissionCodes, 'inventory:manage') - }) - this.loadItems() - }, - - onPullDownRefresh() { - this.loadItems().finally(() => { - wx.stopPullDownRefresh() - }) - }, - - async loadItems() { - this.setData({ loading: true }) - try { - const response = await inventoryApi.listItems({ - page: 1, - size: 30 - }) - this.setData({ - list: safeList(response).map(item => this.formatItem(item)), - total: Number(response && response.total) || 0 - }) - } catch (error) { - wx.showToast({ - title: error.message || '库存加载失败', - icon: 'none' - }) - } finally { - this.setData({ loading: false }) - } - }, - - formatItem(item) { - return { - ...item, - displayStock: format.formatPrice(item.stockQuantity), - displayWarning: format.formatPrice(item.warningThreshold), - statusText: Number(item.status) === 0 ? '停用' : '启用' - } - }, - - handleFormInput(event) { - const field = event.currentTarget.dataset.field - if (!field) { - return - } - this.setData({ - [`form.${field}`]: event.detail.value - }) - }, - - async handleSaveItem() { - if (!this.data.canManage) { - wx.showToast({ - title: '当前账号没有库存维护权限', - icon: 'none' - }) - return - } - const form = this.data.form - if (!String(form.itemName || '').trim()) { - wx.showToast({ - title: '请填写物料名称', - icon: 'none' - }) - return - } - try { - await inventoryApi.saveItem({ - itemName: String(form.itemName || '').trim(), - category: String(form.category || '').trim(), - unit: String(form.unit || '').trim() || '件', - stockQuantity: Number(form.stockQuantity) || 0, - warningThreshold: Number(form.warningThreshold) || 0, - status: 1 - }) - markDirty('admin-workbench') - wx.showToast({ - title: '物料已保存', - icon: 'none' - }) - this.setData({ - form: { - itemName: '', - category: '', - unit: '件', - stockQuantity: '0', - warningThreshold: '1' - } - }) - this.loadItems() - } catch (error) { - wx.showToast({ - title: error.message || '物料保存失败', - icon: 'none' - }) - } - }, - - promptAdjust(item) { - return new Promise(resolve => { - wx.showModal({ - title: `调整 ${item.itemName}`, - content: '填写正数入库,负数出库。', - editable: true, - placeholderText: '例如 5 或 -2', - confirmText: '调整', - success: result => { - if (!result.confirm) { - resolve(null) - return - } - resolve(String(result.content || '').trim()) - }, - fail: () => resolve(null) - }) - }) - }, - - async handleAdjust(event) { - if (!this.data.canManage) { - wx.showToast({ - title: '当前账号没有库存调整权限', - icon: 'none' - }) - return - } - const item = event.currentTarget.dataset.item - if (!item) { - return - } - const value = await this.promptAdjust(item) - if (value === null) { - return - } - const quantity = Number(value) - if (!isFinite(quantity) || quantity === 0) { - wx.showToast({ - title: '请输入非 0 数量', - icon: 'none' - }) - return - } - try { - await inventoryApi.adjustStock(item.id, { - changeType: quantity > 0 ? 'IN' : 'OUT', - changeQuantity: quantity, - remark: '管理端小程序调整' - }) - markDirty('admin-workbench') - wx.showToast({ - title: '库存已调整', - icon: 'none' - }) - this.loadItems() - } catch (error) { - wx.showToast({ - title: error.message || '库存调整失败', - icon: 'none' - }) - } - }, - - handleBack() { - navigation.goBack('/pages/manage/index') - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/inventory/index.json b/FD-WeChat-Fronted/admin/pages/inventory/index.json deleted file mode 100644 index 696ffd1c..00000000 --- a/FD-WeChat-Fronted/admin/pages/inventory/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - }, - "enablePullDownRefresh": true -} diff --git a/FD-WeChat-Fronted/admin/pages/inventory/index.wxml b/FD-WeChat-Fronted/admin/pages/inventory/index.wxml deleted file mode 100644 index 53a5674e..00000000 --- a/FD-WeChat-Fronted/admin/pages/inventory/index.wxml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - Inventory - 耗材库存 - 查看库存和预警项,支持手机端快速新增物料与正负数调整库存。 - - - - 新增物料 - - - - - - - - - - - - 库存列表 - 共 {{total}} 个物料,低于阈值会标记为预警。 - - - - - - - {{item.itemName}} - {{item.category || '未分类'}} · {{item.statusText}} - - {{item.warning ? '库存预警' : '正常'}} - - - - 当前库存 - {{item.displayStock}} {{item.unit || ''}} - - - 预警阈值 - {{item.displayWarning}} {{item.unit || ''}} - - - - 调整库存 - - - - - - 暂无库存物料 - 当前店铺还没有录入耗材库存。 - - - diff --git a/FD-WeChat-Fronted/admin/pages/inventory/index.wxss b/FD-WeChat-Fronted/admin/pages/inventory/index.wxss deleted file mode 100644 index 37003e37..00000000 --- a/FD-WeChat-Fronted/admin/pages/inventory/index.wxss +++ /dev/null @@ -1,15 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} - -.form-grid { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 14rpx; - margin-top: 18rpx; -} - -.compact-btn { - margin-top: 18rpx; -} diff --git a/FD-WeChat-Fronted/admin/pages/login/index.js b/FD-WeChat-Fronted/admin/pages/login/index.js deleted file mode 100644 index ca124f72..00000000 --- a/FD-WeChat-Fronted/admin/pages/login/index.js +++ /dev/null @@ -1,447 +0,0 @@ -/** - * Purpose: authApi supports index.js by holding or executing the auth api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const authApi = require('../../api/auth') -/** - * Purpose: auth supports index.js by holding or executing the auth page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const auth = require('../../utils/auth') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -const { runWithLoading } = require('../../utils/loading') -const sessionSwitch = require('../../../utils/session-switch') - -/** - * Purpose: ACCOUNT_REGEX supports index.js by holding or executing the account regex page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const ACCOUNT_REGEX = /[^A-Za-z0-9]/g - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: redirect supports index.js by holding or executing the redirect page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - redirect: '', - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: account supports index.js by holding or executing the account page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - account: '', - /** - * Purpose: password supports index.js by holding or executing the password page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - password: '', - /** - * Purpose: shopId supports index.js by holding or executing the shop id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopId: '' - }, - /** - * Purpose: loginShops supports index.js by holding or executing the login shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShops: [], - /** - * Purpose: loginShopIndex supports index.js by holding or executing the login shop index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopIndex: -1, - /** - * Purpose: loginShopDisplayName supports index.js by holding or executing the login shop display name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopDisplayName: '', - /** - * Purpose: allowShoplessLogin supports index.js by holding or executing the allow shopless login page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - allowShoplessLogin: false, - /** - * Purpose: loginShopMessage supports index.js by holding or executing the login shop message page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopMessage: '', - /** - * Purpose: accountStatusText supports index.js by holding or executing the account status text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - accountStatusText: '', - /** - * Purpose: accountStatusType supports index.js by holding or executing the account status type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - accountStatusType: '', - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false - }, - - /** - * Purpose: onLoad supports index.js by holding or executing the on load page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onLoad(options) { - this._lookupTicket = 0 - this.setData({ - /** - * Purpose: redirect supports index.js by holding or executing the redirect page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - redirect: options && options.redirect ? options.redirect : '' - }) - - if (auth.isLoggedIn()) { - navigation.redirectAfterLogin(this.data.redirect).catch(() => undefined) - } - }, - - /** - * Purpose: onUnload supports index.js by holding or executing the on unload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onUnload() { - if (this._accountTimer) { - clearTimeout(this._accountTimer) - } - }, - - /** - * Purpose: handleInputChange supports index.js by holding or executing the handle input change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleInputChange(event) { - const field = event.currentTarget.dataset.field - let value = event.detail.value - - if (field === 'account') { - value = String(value || '').replace(ACCOUNT_REGEX, '') - this.resetAccountState() - if (value) { - this.scheduleAccountLookup(value) - } - } - - this.setData({ - [`form.${field}`]: value - }) - }, - - /** - * Purpose: handleShopChange supports index.js by holding or executing the handle shop change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleShopChange(event) { - const index = Number(event.detail.value) - const shop = this.data.loginShops[index] - - this.setData({ - /** - * Purpose: loginShopIndex supports index.js by holding or executing the login shop index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopIndex: index, - /** - * Purpose: loginShopDisplayName supports index.js by holding or executing the login shop display name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopDisplayName: shop ? shop.shopName || '' : '', - 'form.shopId': shop ? shop.id : '' - }) - }, - - /** - * Purpose: resetAccountState supports index.js by holding or executing the reset account state page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - resetAccountState() { - if (this._accountTimer) { - clearTimeout(this._accountTimer) - } - - this._lookupTicket += 1 - - this.setData({ - /** - * Purpose: accountStatusText supports index.js by holding or executing the account status text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - accountStatusText: '', - /** - * Purpose: accountStatusType supports index.js by holding or executing the account status type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - accountStatusType: '', - /** - * Purpose: loginShops supports index.js by holding or executing the login shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShops: [], - /** - * Purpose: loginShopIndex supports index.js by holding or executing the login shop index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopIndex: -1, - /** - * Purpose: loginShopDisplayName supports index.js by holding or executing the login shop display name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopDisplayName: '', - /** - * Purpose: allowShoplessLogin supports index.js by holding or executing the allow shopless login page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - allowShoplessLogin: false, - /** - * Purpose: loginShopMessage supports index.js by holding or executing the login shop message page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopMessage: '', - 'form.shopId': '' - }) - }, - - /** - * Purpose: scheduleAccountLookup supports index.js by holding or executing the schedule account lookup page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - scheduleAccountLookup(account) { - if (this._accountTimer) { - clearTimeout(this._accountTimer) - } - - const ticket = this._lookupTicket + 1 - this._lookupTicket = ticket - this._accountTimer = setTimeout(() => { - this.loadLoginShops(account, ticket) - }, 420) - }, - - /** - * Purpose: applyLoginShopSelection supports index.js by holding or executing the apply login shop selection page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - applyLoginShopSelection(selection) { - const shops = Array.isArray(selection && selection.shops) ? selection.shops : [] - const allowShoplessLogin = Boolean(selection && selection.allowShoplessLogin) - let loginShopIndex = -1 - let loginShopDisplayName = '' - let shopId = '' - - if (!allowShoplessLogin && shops.length === 1) { - loginShopIndex = 0 - loginShopDisplayName = shops[0].shopName || '' - shopId = shops[0].id - } - - this.setData({ - /** - * Purpose: loginShops supports index.js by holding or executing the login shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShops: shops, - allowShoplessLogin, - /** - * Purpose: loginShopMessage supports index.js by holding or executing the login shop message page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopMessage: (selection && selection.message) || '', - loginShopIndex, - loginShopDisplayName, - 'form.shopId': shopId, - /** - * Purpose: accountStatusText supports index.js by holding or executing the account status text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - accountStatusText: shops.length || allowShoplessLogin ? '该账号可用于后台登录' : '当前账号暂时不可用于后台登录', - /** - * Purpose: accountStatusType supports index.js by holding or executing the account status type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - accountStatusType: shops.length || allowShoplessLogin ? 'success' : 'warning' - }) - }, - - async loadLoginShops(account, ticket) { - if (!account) { - this.resetAccountState() - return - } - - try { - const result = await authApi.getLoginShops(account) - if (ticket !== this._lookupTicket || this.data.form.account !== account) { - return - } - this.applyLoginShopSelection(result) - } catch (error) { - if (ticket !== this._lookupTicket || this.data.form.account !== account) { - return - } - this.setData({ - /** - * Purpose: loginShops supports index.js by holding or executing the login shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShops: [], - /** - * Purpose: loginShopIndex supports index.js by holding or executing the login shop index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopIndex: -1, - /** - * Purpose: loginShopDisplayName supports index.js by holding or executing the login shop display name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopDisplayName: '', - /** - * Purpose: allowShoplessLogin supports index.js by holding or executing the allow shopless login page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - allowShoplessLogin: false, - /** - * Purpose: loginShopMessage supports index.js by holding or executing the login shop message page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loginShopMessage: '', - 'form.shopId': '', - /** - * Purpose: accountStatusText supports index.js by holding or executing the account status text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - accountStatusText: error.message || '该后台账号不存在或不可登录', - /** - * Purpose: accountStatusType supports index.js by holding or executing the account status type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - accountStatusType: 'error' - }) - } - }, - - /** - * Purpose: validateForm supports index.js by holding or executing the validate form page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - validateForm() { - const form = this.data.form - if (!form.account) { - return '请输入后台账号' - } - if (!form.password) { - return '请输入登录密码' - } - if (!this.data.allowShoplessLogin && this.data.loginShops.length && !form.shopId) { - return '请选择登录店铺' - } - return '' - }, - - async handleSubmit() { - const errorMessage = this.validateForm() - if (errorMessage) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: errorMessage, - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - - this.setData({ - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: true - }) - - try { - const payload = await runWithLoading(() => authApi.login({ - /** - * Purpose: account supports index.js by holding or executing the account page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - account: this.data.form.account, - /** - * Purpose: password supports index.js by holding or executing the password page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - password: this.data.form.password, - /** - * Purpose: shopId supports index.js by holding or executing the shop id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopId: this.data.form.shopId || undefined - })) - - await getApp().setAdminSession(payload) - - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '登录成功', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - - await navigation.redirectAfterLogin(this.data.redirect) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '登录失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } finally { - this.setData({ - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false - }) - } - }, - - handleOpenCustomerHome() { - sessionSwitch.openCustomerHome() - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/login/index.json b/FD-WeChat-Fronted/admin/pages/login/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/login/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/login/index.wxml b/FD-WeChat-Fronted/admin/pages/login/index.wxml deleted file mode 100644 index fc81d6c6..00000000 --- a/FD-WeChat-Fronted/admin/pages/login/index.wxml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - diff --git a/FD-WeChat-Fronted/admin/pages/login/index.wxss b/FD-WeChat-Fronted/admin/pages/login/index.wxss deleted file mode 100644 index bf0f6403..00000000 --- a/FD-WeChat-Fronted/admin/pages/login/index.wxss +++ /dev/null @@ -1,23 +0,0 @@ -@import "../../app.wxss"; -.login-stack { - padding-top: 40rpx; -} - -.hero-logo { - width: 112rpx; - height: 112rpx; - margin-bottom: 22rpx; - border-radius: 30rpx; - background: rgba(246, 239, 231, 0.12); - box-shadow: 0 18rpx 42rpx rgba(7, 20, 23, 0.28); -} - -.customer-switch-link { - display: flex; - align-items: center; - justify-content: center; - min-height: 72rpx; - color: #f7dba7; - font-size: 26rpx; - font-weight: 700; -} diff --git a/FD-WeChat-Fronted/admin/pages/manage/index.js b/FD-WeChat-Fronted/admin/pages/manage/index.js deleted file mode 100644 index 6fa16180..00000000 --- a/FD-WeChat-Fronted/admin/pages/manage/index.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: permission supports index.js by holding or executing the permission page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const permission = require('../../utils/permission') - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: userInfo supports index.js by holding or executing the user info page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userInfo: null, - /** - * Purpose: currentShop supports index.js by holding or executing the current shop page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - currentShop: null, - /** - * Purpose: modules supports index.js by holding or executing the modules page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - modules: [] - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入经营模块')) { - return - } - - const app = getApp() - const userInfo = app.globalData.userInfo - const currentShop = app.globalData.currentShop - const permissionCodes = app.globalData.permissionCodes || [] - - this.setData({ - userInfo, - currentShop, - /** - * Purpose: modules supports index.js by holding or executing the modules page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - modules: permission.getManageModules(userInfo, permissionCodes, currentShop) - }) - }, - - handleOpenWorkbench() { - navigation.switchTab('/pages/workbench/index').catch(() => undefined) - }, - - handleOpenOrders() { - navigation.switchTab('/pages/orders/index').catch(() => undefined) - }, - - handleOpenProfile() { - navigation.switchTab('/pages/profile/index').catch(() => undefined) - }, - - /** - * Purpose: handleOpenModule supports index.js by holding or executing the handle open module page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleOpenModule(event) { - const module = event.currentTarget.dataset.module - if (!module) { - return - } - - if (!module.allowed) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: module.disabledReason || '当前账号没有进入该模块的权限', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - - navigation.navigate(module.path).catch(() => undefined) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/manage/index.json b/FD-WeChat-Fronted/admin/pages/manage/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/manage/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/manage/index.wxml b/FD-WeChat-Fronted/admin/pages/manage/index.wxml deleted file mode 100644 index 61775173..00000000 --- a/FD-WeChat-Fronted/admin/pages/manage/index.wxml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - 按权限展示 - {{currentShop ? currentShop.shopName : '平台级入口'}} - 这里不复刻网页后台的大表格首页,而是把可用模块拆成移动端更好点到的入口卡片。 - - - 当前是平台总览模式。用户、作品、订单、优惠券、标签、美甲师等店铺业务可以查看,编辑操作由服务端关闭。 - - - - - - {{item.title}} - {{item.description}} - - {{item.readonly ? '仅查看' : (item.allowed ? '可进入' : '待解锁')}} - - {{item.disabledReason}} - - - - 工作台 - 订单 - 经营 - 我的 - - - diff --git a/FD-WeChat-Fronted/admin/pages/manage/index.wxss b/FD-WeChat-Fronted/admin/pages/manage/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/manage/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/order-detail/index.js b/FD-WeChat-Fronted/admin/pages/order-detail/index.js deleted file mode 100644 index 2ea8d348..00000000 --- a/FD-WeChat-Fronted/admin/pages/order-detail/index.js +++ /dev/null @@ -1,199 +0,0 @@ -/** - * Purpose: orderApi loads full backend order detail so direct entry and message navigation can render complete data. - * Usage: call getOrderDetail with the current route id before displaying the order detail page. - */ -const orderApi = require('../../api/order') -const paymentApi = require('../../api/payment') -const permission = require('../../utils/permission') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: format supports index.js by holding or executing the format page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const format = require('../../utils/format') -const { getTempRecord, clearTempRecord } = require('../../utils/storage') -const { markDirty } = require('../../utils/page-state') - -function getPaymentStatusText(status) { - if (status === 'PAID') { - return '已支付' - } - if (status === 'PAYING') { - return '支付中' - } - if (status === 'REFUNDED') { - return '已退款' - } - return '未支付' -} - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: loading marks whether the detail endpoint is currently fetching order data. - * Usage: bind it to loading and retry states while preserving any cached order shown on screen. - */ - loading: false, - /** - * Purpose: orderId keeps the backend order id used by reload and direct-entry flows. - * Usage: set it from route options or cached list data before calling loadOrderDetail. - */ - orderId: '', - /** - * Purpose: order supports index.js by holding or executing the order page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - order: null, - canManualConfirmPay: false - }, - - /** - * Purpose: onLoad supports index.js by holding or executing the on load page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onLoad(options) { - const permissionCodes = getApp().globalData.permissionCodes || [] - const cachedOrder = getTempRecord('currentOrder', null) - const orderId = (options && options.id) || (cachedOrder && cachedOrder.id) || '' - this.setData({ - orderId, - order: cachedOrder ? this.formatOrder(cachedOrder) : null, - canManualConfirmPay: permission.hasPermission(permissionCodes, 'payment:manage') - }) - - if (orderId) { - this.loadOrderDetail(orderId) - } - }, - - /** - * Purpose: loadOrderDetail replaces list-row summary data with the authoritative admin order-detail response. - * Usage: call it from onLoad and retry buttons with the backend order id; failures leave cached data visible. - */ - async loadOrderDetail(orderId) { - this.setData({ loading: true }) - try { - const detail = await orderApi.getOrderDetail(orderId) - this.setData({ - order: this.formatOrder(detail) - }) - } catch (error) { - wx.showToast({ - title: error.message || '订单详情加载失败', - icon: 'none' - }) - } finally { - this.setData({ loading: false }) - } - }, - - /** - * Purpose: formatOrder prepares order and item fields for WXML, including review and change-request summaries. - * Usage: run every cached or fetched order object through this method before assigning it to data.order. - */ - formatOrder(order) { - const items = Array.isArray(order && order.items) ? order.items : [] - const paymentStatus = order && order.paymentStatus ? order.paymentStatus : 'UNPAID' - return order ? { - ...order, - displayStatusText: format.getOrderStatusText(order), - displayPaymentStatusText: getPaymentStatusText(paymentStatus), - displayCreateTime: format.formatDateTime(order.createTime), - displayPayAmount: format.formatPrice(order.payAmount || order.actualAmount), - displayPaidAmount: format.formatPrice(order.paidAmount), - displayPayTime: format.formatDateTime(order.payTime), - canManualConfirmPay: paymentStatus !== 'PAID' && paymentStatus !== 'REFUNDED', - items: items.map(item => ({ - ...item, - displayAppointmentTime: item.appointmentTime ? format.formatDateTime(item.appointmentTime) : '', - reviewStatusText: item.reviewStatusText || (item.reviewSummary ? '已评价' : '待评价'), - changeStatusText: item.pendingArtistChangeRequest ? item.pendingArtistChangeRequest.displayText : '' - })) - } : null - }, - - /** - * Purpose: handleRetry reloads backend detail when direct entry failed or no cached data exists. - * Usage: bind it to the empty state action so operators can recover without returning to the list. - */ - handleRetry() { - if (!this.data.orderId) { - navigation.goBack('/pages/orders/index') - return - } - this.loadOrderDetail(this.data.orderId) - }, - - async handleManualConfirmPay() { - if (!this.data.canManualConfirmPay) { - wx.showToast({ - title: '当前账号没有确认支付权限', - icon: 'none' - }) - return - } - const order = this.data.order - if (!order) { - return - } - const remark = await new Promise(resolve => { - wx.showModal({ - title: '手动确认支付', - content: `确认将订单 ${order.orderNo || order.id} 标记为已支付?`, - editable: true, - placeholderText: '备注,可留空', - confirmText: '确认', - success: result => { - if (!result.confirm) { - resolve(null) - return - } - resolve(String(result.content || '').trim()) - }, - fail: () => resolve(null) - }) - }) - if (remark === null) { - return - } - try { - await paymentApi.manualConfirmOrder(order.id, remark) - markDirty('admin-orders') - markDirty('admin-workbench') - wx.showToast({ - title: '支付已确认', - icon: 'none' - }) - this.loadOrderDetail(order.id) - } catch (error) { - wx.showToast({ - title: error.message || '确认支付失败', - icon: 'none' - }) - } - }, - - /** - * Purpose: onUnload supports index.js by holding or executing the on unload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onUnload() { - clearTempRecord('currentOrder') - }, - - /** - * Purpose: handleBack supports index.js by holding or executing the handle back page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleBack() { - navigation.goBack('/pages/orders/index') - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/order-detail/index.json b/FD-WeChat-Fronted/admin/pages/order-detail/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/order-detail/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/order-detail/index.wxml b/FD-WeChat-Fronted/admin/pages/order-detail/index.wxml deleted file mode 100644 index 297ae75c..00000000 --- a/FD-WeChat-Fronted/admin/pages/order-detail/index.wxml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - {{order.orderNo}} - {{order.displayStatusText}} · {{order.displayCreateTime}} - - - 用户昵称 - {{order.customerNickname || order.userNickname || '--'}} - - - 脱敏手机号 - {{order.customerPhoneMasked || '--'}} - - - 所属店铺 - {{order.shopName || '--'}} - - - 美甲师 - {{order.artistName || '--'}} - - - 应付金额 - ¥{{order.displayPayAmount || '--'}} - - - 支付状态 - {{order.displayPaymentStatusText}} - - - 已付金额 - ¥{{order.displayPaidAmount}} - - - 支付时间 - {{order.displayPayTime || '--'}} - - - 备注 - {{order.remark || '暂无备注'}} - - - - - - - - - 服务项目 - - - - {{item.productTitle || '订单项目'}} - {{item.reviewStatusText}} - - 美甲师:{{item.artistName || '--'}} - 预约时间:{{item.displayAppointmentTime}} - 评价内容:{{item.reviewSummary.contentText}} - - 改派申请 - {{item.pendingArtistChangeRequest.displayText}} - 原因:{{item.pendingArtistChangeRequest.reasonText}} - - - - - - - 订单详情暂不可用 - 当前详情页可通过列表、消息或订单 id 打开;加载失败时可重试。 - - - - diff --git a/FD-WeChat-Fronted/admin/pages/order-detail/index.wxss b/FD-WeChat-Fronted/admin/pages/order-detail/index.wxss deleted file mode 100644 index 73def12b..00000000 --- a/FD-WeChat-Fronted/admin/pages/order-detail/index.wxss +++ /dev/null @@ -1,56 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} - -.detail-item { - display: flex; - flex-direction: column; - gap: 12rpx; - padding: 20rpx 0; - border-top: 1rpx solid rgba(255, 255, 255, 0.08); -} - -.detail-item:first-of-type { - border-top: 0; -} - -.detail-item-head { - display: flex; - align-items: center; - justify-content: space-between; - gap: 16rpx; -} - -.detail-item-title { - color: #f6efe7; - font-size: 30rpx; - font-weight: 700; -} - -.detail-item-line { - color: #9fb3ad; - font-size: 24rpx; - line-height: 1.6; -} - -.change-box { - display: flex; - flex-direction: column; - gap: 8rpx; - padding: 16rpx; - border-radius: 8rpx; - background: rgba(240, 126, 87, 0.1); -} - -.change-title { - color: #f6efe7; - font-size: 24rpx; - font-weight: 700; -} - -.change-line { - color: #f4c7b8; - font-size: 24rpx; - line-height: 1.5; -} diff --git a/FD-WeChat-Fronted/admin/pages/orders/index.js b/FD-WeChat-Fronted/admin/pages/orders/index.js deleted file mode 100644 index 26e9dcff..00000000 --- a/FD-WeChat-Fronted/admin/pages/orders/index.js +++ /dev/null @@ -1,753 +0,0 @@ -/** - * Purpose: orderApi supports index.js by holding or executing the order api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const orderApi = require('../../api/order') -const paymentApi = require('../../api/payment') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: permission supports index.js by holding or executing the permission page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const permission = require('../../utils/permission') -/** - * Purpose: format supports index.js by holding or executing the format page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const format = require('../../utils/format') -const { setTempRecord } = require('../../utils/storage') -const { consumeDirty, markDirty } = require('../../utils/page-state') - -/** - * Purpose: STATUS_OPTIONS supports index.js by holding or executing the status options page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const STATUS_OPTIONS = [ - { label: '全部', value: '' }, - { label: '待服务', value: 1 }, - { label: '已完成', value: 2 }, - { label: '已取消', value: 0 } -] - -/** - * Purpose: toId supports index.js by holding or executing the to id page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function toId(value) { - return value === undefined || value === null ? '' : String(value) -} - -/** - * Purpose: sameId supports index.js by holding or executing the same id page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function sameId(left, right) { - const leftId = toId(left) - const rightId = toId(right) - return leftId !== '' && leftId === rightId -} - -/** - * Purpose: safeList supports index.js by holding or executing the safe list page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function safeList(value) { - return Array.isArray(value) ? value : [] -} - -/** - * Purpose: trimText supports index.js by holding or executing the trim text page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function trimText(value) { - return String(value || '').trim() -} - -/** - * Purpose: formatRating supports index.js by holding or executing the format rating page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function formatRating(value) { - const rating = Number(value) - if (!isFinite(rating) || rating <= 0) { - return '' - } - return rating % 1 === 0 ? String(rating) : rating.toFixed(1) -} - -function getPaymentStatusText(status) { - if (status === 'PAID') { - return '已支付' - } - if (status === 'PAYING') { - return '支付中' - } - if (status === 'REFUNDED') { - return '已退款' - } - return '未支付' -} - -/** - * Purpose: isSubmittedReview supports index.js by holding or executing the is submitted review page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function isSubmittedReview(review) { - if (!review) { - return false - } - if (Number(review.status) === 1) { - return true - } - return Boolean(review.rating) -} - -/** - * Purpose: resolveRelatedRecord supports index.js by holding or executing the resolve related record page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function resolveRelatedRecord(source, orderItemId) { - if (Array.isArray(source)) { - return source.find(item => sameId(item && item.orderItemId, orderItemId)) || null - } - if (source && typeof source === 'object') { - if (!source.orderItemId || sameId(source.orderItemId, orderItemId)) { - return source - } - } - return null -} - -/** - * Purpose: buildReviewSummary supports index.js by holding or executing the build review summary page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildReviewSummary(review) { - if (!review || !isSubmittedReview(review)) { - return null - } - const ratingText = formatRating(review.rating) - return { - ...review, - ratingText, - contentText: trimText(review.content), - displayText: ratingText ? `已评价:${ratingText} 分` : (review.statusText || '已评价') - } -} - -/** - * Purpose: buildArtistChangeSummary supports index.js by holding or executing the build artist change summary page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildArtistChangeSummary(request) { - if (!request) { - return null - } - const originalName = request.originalArtistName || '原美甲师' - const requestedName = request.requestedArtistName || '新美甲师' - return { - ...request, - displayText: `${originalName} → ${requestedName}`, - reasonText: trimText(request.reason) - } -} - -/** - * Purpose: indexByOrderItemId supports index.js by holding or executing the index by order item id page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function indexByOrderItemId(list) { - return safeList(list).reduce((result, item) => { - if (item && item.orderItemId) { - result[toId(item.orderItemId)] = item - } - return result - }, {}) -} - -/** - * Purpose: safeCall supports index.js by holding or executing the safe call page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -async function safeCall(factory, fallbackValue) { - try { - const result = await factory() - return result === undefined || result === null ? fallbackValue : result - } catch (error) { - return fallbackValue - } -} - -/** - * Purpose: loadAssistData supports index.js by holding or executing the load assist data page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -async function loadAssistData(orders) { - const pendingChangesPromise = safeCall(() => orderApi.listMyPendingArtistChangeRequests(), []) - const orderReviewListsPromise = Promise.all(orders.map(order => ( - safeCall(() => orderApi.listOrderReviews(order.id), []) - ))) - const [pendingChanges, orderReviewLists] = await Promise.all([ - pendingChangesPromise, - orderReviewListsPromise - ]) - - const submittedReviews = [] - safeList(orderReviewLists).forEach(list => { - safeList(list).forEach(review => { - if (isSubmittedReview(review)) { - submittedReviews.push(review) - } - }) - }) - - return { - pendingChangeByItemId: indexByOrderItemId(pendingChanges), - submittedReviewByItemId: indexByOrderItemId(submittedReviews) - } -} - -/** - * Purpose: hasProductionFlag supports index.js by holding or executing the has production flag page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function hasProductionFlag(userInfo) { - const sources = [ - userInfo && userInfo.participateProduction, - userInfo && userInfo.participateProductionFlag, - userInfo && userInfo.artistParticipateProduction, - userInfo && userInfo.nailArtistInfo && userInfo.nailArtistInfo.participateProduction, - userInfo && userInfo.artistInfo && userInfo.artistInfo.participateProduction - ] - return sources.some(value => value === true || Number(value) === 1) -} - -/** - * Purpose: canRequestArtistChangeForItem supports index.js by holding or executing the can request artist change for item page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function canRequestArtistChangeForItem(userInfo, order, item, pendingChange) { - if (!userInfo || !order || !item || pendingChange || Number(order.status) !== 1) { - return false - } - - if (permission.isNailArtist(userInfo)) { - return !item.artistId || sameId(item.artistId, userInfo.id) - } - - if (sameId(item.artistId, userInfo.id)) { - return true - } - - return permission.isShopManager(userInfo) && hasProductionFlag(userInfo) -} - -/** - * Purpose: formatOrderItem supports index.js by holding or executing the format order item page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function formatOrderItem(order, item, userInfo, assistData) { - const itemId = toId(item.id) - const inlineReviewSummary = resolveRelatedRecord(item.reviewSummary || order.reviewSummary, item.id) - const inlinePendingChange = resolveRelatedRecord(item.pendingArtistChangeRequest || order.pendingArtistChangeRequest, item.id) - const reviewSummary = buildReviewSummary(inlineReviewSummary || assistData.submittedReviewByItemId[itemId]) - const pendingArtistChangeRequest = buildArtistChangeSummary(inlinePendingChange || assistData.pendingChangeByItemId[itemId]) - - return { - ...item, - displayPrice: format.formatPrice(item.price), - displayAppointmentTime: format.formatDateTime(item.appointmentTime), - reviewSummary, - reviewStatusText: reviewSummary ? reviewSummary.displayText : '待评价', - pendingArtistChangeRequest, - canRequestArtistChange: canRequestArtistChangeForItem(userInfo, order, item, pendingArtistChangeRequest) - } -} - -/** - * Purpose: formatOrder supports index.js by holding or executing the format order page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function formatOrder(order, userInfo, assistData) { - const items = safeList(order.items).map(item => formatOrderItem(order, item, userInfo, assistData)) - const orderReviewSummary = buildReviewSummary(order.reviewSummary) - const paymentStatus = order.paymentStatus || 'UNPAID' - return { - ...order, - displayStatusText: format.getOrderStatusText(order), - displayPaymentStatusText: getPaymentStatusText(paymentStatus), - displayCreateTime: format.formatDateTime(order.createTime), - displayPayAmount: format.formatPrice(order.payAmount || order.actualAmount), - displayPaidAmount: format.formatPrice(order.paidAmount), - canManualConfirmPay: paymentStatus !== 'PAID' && paymentStatus !== 'REFUNDED', - items, - reviewSummary: orderReviewSummary, - reviewStatusText: orderReviewSummary ? orderReviewSummary.displayText : '' - } -} - -/** - * Purpose: selectArtist supports index.js by holding or executing the select artist page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function selectArtist(artists) { - return new Promise(resolve => { - wx.showActionSheet({ - itemList: artists.map(item => item.artistName || `美甲师 ${item.artistId}`), - success: result => resolve(artists[result.tapIndex] || null), - fail: () => resolve(null) - }) - }) -} - -/** - * Purpose: promptChangeReason supports index.js by holding or executing the prompt change reason page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function promptChangeReason() { - return new Promise(resolve => { - wx.showModal({ - title: '改派原因', - content: '可填写改派原因,留空也可以提交。', - editable: true, - placeholderText: '例如档期冲突、客户沟通调整', - confirmText: '提交', - success: result => { - if (!result.confirm) { - resolve(null) - return - } - resolve(trimText(result.content)) - }, - fail: () => resolve(null) - }) - }) -} - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: '', - /** - * Purpose: status supports index.js by holding or executing the status page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - status: '', - /** - * Purpose: statusOptions supports index.js by holding or executing the status options page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - statusOptions: STATUS_OPTIONS, - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: [], - /** - * Purpose: total supports index.js by holding or executing the total page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - total: 0, - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false, - /** - * Purpose: userInfo supports index.js by holding or executing the user info page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userInfo: null, - canManualConfirmPay: false, - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: false - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入订单管理')) { - return - } - - const userInfo = getApp().globalData.userInfo - const permissionCodes = getApp().globalData.permissionCodes || [] - this.setData({ - userInfo, - canManualConfirmPay: permission.hasPermission(permissionCodes, 'payment:manage') - }) - - if (!this.data.initialized || consumeDirty('admin-orders')) { - this.loadOrders() - } - }, - - async handleManualConfirmPay(event) { - if (!this.data.canManualConfirmPay) { - wx.showToast({ - title: '当前账号没有确认支付权限', - icon: 'none' - }) - return - } - const order = event.currentTarget.dataset.order - if (!order) { - return - } - const confirmed = await new Promise(resolve => { - wx.showModal({ - title: '手动确认支付', - content: `确认将订单 ${order.orderNo || order.id} 标记为已支付?`, - editable: true, - placeholderText: '备注,可留空', - confirmText: '确认', - success: result => { - if (!result.confirm) { - resolve(null) - return - } - resolve(String(result.content || '').trim()) - }, - fail: () => resolve(null) - }) - }) - if (confirmed === null) { - return - } - try { - await paymentApi.manualConfirmOrder(order.id, confirmed) - markDirty('admin-workbench') - wx.showToast({ - title: '支付已确认', - icon: 'none' - }) - this.loadOrders() - } catch (error) { - wx.showToast({ - title: error.message || '确认支付失败', - icon: 'none' - }) - } - }, - - /** - * Purpose: onPullDownRefresh supports index.js by holding or executing the on pull down refresh page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onPullDownRefresh() { - this.loadOrders().finally(() => { - wx.stopPullDownRefresh() - }) - }, - - /** - * Purpose: handleKeywordInput supports index.js by holding or executing the handle keyword input page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleKeywordInput(event) { - this.setData({ - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: event.detail.value - }) - }, - - /** - * Purpose: handleStatusChange supports index.js by holding or executing the handle status change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleStatusChange(event) { - const status = event.currentTarget.dataset.status - this.setData({ - status - }) - this.loadOrders() - }, - - async loadOrders() { - const requestId = (this._loadRequestId || 0) + 1 - this._loadRequestId = requestId - this.setData({ - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: true - }) - - try { - const result = await orderApi.listOrders({ - /** - * Purpose: page supports index.js by holding or executing the page page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - page: 1, - /** - * Purpose: size supports index.js by holding or executing the size page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - size: 20, - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: this.data.keyword || undefined, - /** - * Purpose: status supports index.js by holding or executing the status page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - status: this.data.status === '' ? undefined : this.data.status - }) - - const rawList = safeList(result && result.list) - const assistData = await loadAssistData(rawList) - - if (requestId !== this._loadRequestId) { - return - } - - this.setData({ - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: rawList.map(item => formatOrder(item, this.data.userInfo, assistData)), - /** - * Purpose: total supports index.js by holding or executing the total page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - total: Number(result && result.total) || 0, - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: true - }) - } catch (error) { - if (requestId !== this._loadRequestId) { - return - } - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '订单加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } finally { - if (requestId === this._loadRequestId) { - this.setData({ - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false - }) - } - } - }, - - /** - * Purpose: handleSearch supports index.js by holding or executing the handle search page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleSearch() { - this.loadOrders() - }, - - handleOpenWorkbench() { - navigation.switchTab('/pages/workbench/index').catch(() => undefined) - }, - - handleOpenManage() { - navigation.switchTab('/pages/manage/index').catch(() => undefined) - }, - - handleOpenProfile() { - navigation.switchTab('/pages/profile/index').catch(() => undefined) - }, - - /** - * Purpose: handleOpenOrder supports index.js by holding or executing the handle open order page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleOpenOrder(event) { - const order = event.currentTarget.dataset.order - if (!order) { - return - } - - setTempRecord('currentOrder', order) - navigation.navigate('/pages/order-detail/index', { - /** - * Purpose: id supports index.js by holding or executing the id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - id: order.id - }).catch(() => undefined) - }, - - async handleRequestArtistChange(event) { - const orderId = event.currentTarget.dataset.orderId - const orderItemId = event.currentTarget.dataset.orderItemId - if (!orderId || !orderItemId) { - return - } - - try { - const options = await orderApi.getArtistChangeOptions(orderId, orderItemId) - const artists = safeList(options && options.artists) - if (!artists.length) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '暂无可改派美甲师', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - - const targetArtist = await selectArtist(artists) - if (!targetArtist) { - return - } - - const reason = await promptChangeReason() - if (reason === null) { - return - } - - await orderApi.requestArtistChange({ - orderId, - orderItemId, - /** - * Purpose: requestedArtistId supports index.js by holding or executing the requested artist id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - requestedArtistId: targetArtist.artistId, - reason - }) - markDirty('admin-workbench') - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '改派申请已提交', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - this.loadOrders() - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '改派申请失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - async handleProcessOrder(event) { - const order = event.currentTarget.dataset.order - if (!order) { - return - } - - const isArtist = permission.isNailArtist(this.data.userInfo) - const options = isArtist - ? [{ label: '标记为已完成', status: 2 }] - : [ - { label: '调整为待服务', status: 1 }, - { label: '标记为已完成', status: 2 }, - { label: '标记为已取消', status: 0 } - ] - - wx.showActionSheet({ - /** - * Purpose: itemList supports index.js by holding or executing the item list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - itemList: options.map(item => item.label), - /** - * Purpose: success supports index.js by holding or executing the success page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - success: async result => { - const target = options[result.tapIndex] - if (!target) { - return - } - - try { - await orderApi.updateOrderStatus(order.id, target.status) - markDirty('admin-workbench') - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '订单状态已更新', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - this.loadOrders() - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '订单处理失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } - }) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/orders/index.json b/FD-WeChat-Fronted/admin/pages/orders/index.json deleted file mode 100644 index 696ffd1c..00000000 --- a/FD-WeChat-Fronted/admin/pages/orders/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - }, - "enablePullDownRefresh": true -} diff --git a/FD-WeChat-Fronted/admin/pages/orders/index.wxml b/FD-WeChat-Fronted/admin/pages/orders/index.wxml deleted file mode 100644 index f57c97f9..00000000 --- a/FD-WeChat-Fronted/admin/pages/orders/index.wxml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - 预约履约 - 按当前角色范围查看订单 - 店长和平台管理员看当前权限范围订单,美甲师仅看属于自己的预约单,并只能完成属于自己的订单。 - - - - 筛选条件 - - - - - - - {{item.label}} - - - - - - - - - {{item.orderNo}} - {{item.customerNickname || item.userNickname || '未命名用户'}} · {{item.customerPhoneMasked || '--'}} - - {{item.displayStatusText}} - - - - 订单金额 - ¥{{item.displayPayAmount}} - - - 支付状态 - {{item.displayPaymentStatusText}} - - - 所属门店 - {{item.shopName || '--'}} - - - 美甲师 - {{item.artistName || '--'}} - - - 下单时间 - {{item.displayCreateTime}} - - - - - - - {{orderItem.productTitle || '订单项目'}} - 美甲师:{{orderItem.artistName || '--'}} - 预约时间:{{orderItem.displayAppointmentTime}} - {{orderItem.reviewStatusText}} - 评价内容:{{orderItem.reviewSummary.contentText}} - - 改派申请待处理 - {{orderItem.pendingArtistChangeRequest.displayText}} - 原因:{{orderItem.pendingArtistChangeRequest.reasonText}} - - - 申请改派 - - - - {{item.reviewStatusText}} - - - 查看详情 - 确认支付 - 处理订单 - - - - - - 暂无订单 - 当前筛选条件下没有符合的订单记录,切换状态或清空关键字后再试一次。 - - - 工作台 - 订单 - 经营 - 我的 - - - diff --git a/FD-WeChat-Fronted/admin/pages/orders/index.wxss b/FD-WeChat-Fronted/admin/pages/orders/index.wxss deleted file mode 100644 index da9041b7..00000000 --- a/FD-WeChat-Fronted/admin/pages/orders/index.wxss +++ /dev/null @@ -1,83 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} - -.order-items { - margin-top: 22rpx; - border-top: 1rpx solid rgba(246, 239, 231, 0.12); -} - -.order-item-row { - display: flex; - align-items: flex-start; - justify-content: space-between; - gap: 18rpx; - padding: 18rpx 0; - border-bottom: 1rpx solid rgba(246, 239, 231, 0.1); -} - -.order-item-row:last-child { - border-bottom: 0; - padding-bottom: 0; -} - -.order-item-main { - flex: 1; - min-width: 0; -} - -.order-item-title, -.order-item-line, -.order-item-review, -.order-review-line, -.change-note-title, -.change-note-desc { - display: block; -} - -.order-item-title { - color: #f6efe7; - font-size: 26rpx; - font-weight: 700; - line-height: 1.5; -} - -.order-item-line, -.order-review-line, -.change-note-desc { - margin-top: 8rpx; - color: rgba(246, 239, 231, 0.68); - font-size: 23rpx; - line-height: 1.55; -} - -.order-item-review { - margin-top: 10rpx; - color: #f0c987; - font-size: 23rpx; - font-weight: 700; - line-height: 1.5; -} - -.change-note { - margin-top: 14rpx; - padding: 16rpx; - border-radius: 14rpx; - background: rgba(240, 201, 135, 0.1); - border: 1rpx solid rgba(240, 201, 135, 0.3); -} - -.change-note-title { - color: #f0c987; - font-size: 23rpx; - font-weight: 700; - line-height: 1.5; -} - -.mini-btn.soft { - color: #081518; - background: #f0c987; - border-color: #f0c987; - white-space: nowrap; -} diff --git a/FD-WeChat-Fronted/admin/pages/permission-form/index.js b/FD-WeChat-Fronted/admin/pages/permission-form/index.js deleted file mode 100644 index 0c76e1e9..00000000 --- a/FD-WeChat-Fronted/admin/pages/permission-form/index.js +++ /dev/null @@ -1,333 +0,0 @@ -/** - * Purpose: permissionApi supports index.js by holding or executing the permission api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const permissionApi = require('../../api/permission') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: permissionUtils supports index.js by holding or executing the permission utils page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const permissionUtils = require('../../utils/permission') -const { getTempRecord, clearTempRecord } = require('../../utils/storage') - -/** - * Purpose: buildPermissionGroups supports index.js by holding or executing the build permission groups page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildPermissionGroups(list, checkedIds, assignableIds) { - const groups = permissionUtils.groupPermissionsByGroup(list) - return Object.keys(groups).map(group => ({ - group, - items: groups[group].map(item => ({ - ...item, - valueId: String(item.id), - checked: checkedIds.includes(String(item.id)), - disabled: assignableIds.length ? !assignableIds.includes(String(item.id)) : false - })) - })) -} - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'definition-create', - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '', - /** - * Purpose: userId supports index.js by holding or executing the user id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userId: '', - /** - * Purpose: currentUser supports index.js by holding or executing the current user page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - currentUser: null, - /** - * Purpose: permissionGroups supports index.js by holding or executing the permission groups page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionGroups: [], - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: permissionCode supports index.js by holding or executing the permission code page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionCode: '', - /** - * Purpose: permissionName supports index.js by holding or executing the permission name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionName: '', - /** - * Purpose: permissionGroup supports index.js by holding or executing the permission group page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionGroup: '', - /** - * Purpose: description supports index.js by holding or executing the description page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - description: '' - } - }, - - /** - * Purpose: onLoad supports index.js by holding or executing the on load page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onLoad(options) { - const mode = options && options.mode ? options.mode : 'definition-create' - this.setData({ - mode, - /** - * Purpose: userId supports index.js by holding or executing the user id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userId: options && options.userId ? options.userId : '', - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: mode === 'assign' ? '分配权限' : (mode === 'definition-edit' ? '编辑权限' : '新增权限') - }) - - if (mode === 'assign') { - this.loadAssignData() - return - } - - const currentPermission = getTempRecord('currentPermission', null) - if (mode === 'definition-edit' && currentPermission) { - this.setData({ - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: permissionCode supports index.js by holding or executing the permission code page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionCode: currentPermission.permissionCode || '', - /** - * Purpose: permissionName supports index.js by holding or executing the permission name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionName: currentPermission.permissionName || '', - /** - * Purpose: permissionGroup supports index.js by holding or executing the permission group page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionGroup: currentPermission.permissionGroup || '', - /** - * Purpose: description supports index.js by holding or executing the description page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - description: currentPermission.description || '' - } - }) - } - }, - - /** - * Purpose: onUnload supports index.js by holding or executing the on unload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onUnload() { - clearTempRecord('currentPermission') - }, - - async loadAssignData() { - const currentUser = getTempRecord('currentUser', null) - this.setData({ - currentUser - }) - - try { - const [allPermissions, currentPermissions, assignableIds] = await Promise.all([ - permissionApi.listAllPermissions(), - permissionApi.getUserPermissions(this.data.userId), - permissionApi.getAssignablePermissionIds(this.data.userId) - ]) - - const checkedIds = (Array.isArray(currentPermissions) ? currentPermissions : []).map(item => String(item.id)) - const normalizedAssignableIds = (Array.isArray(assignableIds) ? assignableIds : []).map(item => String(item)) - - this.setData({ - /** - * Purpose: permissionGroups supports index.js by holding or executing the permission groups page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionGroups: buildPermissionGroups(allPermissions, checkedIds, normalizedAssignableIds) - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '权限数据加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleInputChange supports index.js by holding or executing the handle input change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleInputChange(event) { - const field = event.currentTarget.dataset.field - this.setData({ - [`form.${field}`]: event.detail.value - }) - }, - - /** - * Purpose: handlePermissionCheck supports index.js by holding or executing the handle permission check page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handlePermissionCheck(event) { - const selected = event.detail.value || [] - this.setData({ - /** - * Purpose: permissionGroups supports index.js by holding or executing the permission groups page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionGroups: this.data.permissionGroups.map(group => ({ - ...group, - /** - * Purpose: items supports index.js by holding or executing the items page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - items: group.items.map(item => ({ - ...item, - /** - * Purpose: checked supports index.js by holding or executing the checked page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - checked: item.disabled ? item.checked : selected.includes(item.valueId) - })) - })) - }) - }, - - async handleSubmit() { - if (this.data.mode === 'assign') { - const permissionIds = [] - this.data.permissionGroups.forEach(group => { - group.items.forEach(item => { - if (item.checked) { - permissionIds.push(Number(item.id)) - } - }) - }) - - try { - await permissionApi.assignUserPermissions(this.data.userId, permissionIds) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '权限已保存', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - navigation.goBack('/pages/permissions/index') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '权限保存失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - return - } - - if (!this.data.form.permissionCode || !this.data.form.permissionName) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '请补全权限编码和名称', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - - try { - if (this.data.mode === 'definition-edit') { - const currentPermission = getTempRecord('currentPermission', null) - await permissionApi.updatePermission(currentPermission.id, this.data.form) - } else { - await permissionApi.createPermission(this.data.form) - } - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '权限定义已保存', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - navigation.goBack('/pages/permissions/index') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '保存失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/permission-form/index.json b/FD-WeChat-Fronted/admin/pages/permission-form/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/permission-form/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/permission-form/index.wxml b/FD-WeChat-Fronted/admin/pages/permission-form/index.wxml deleted file mode 100644 index 64659f5a..00000000 --- a/FD-WeChat-Fronted/admin/pages/permission-form/index.wxml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - {{currentUser.nickname || currentUser.account}} - 只能勾选当前账号被允许拥有的权限。超出允许范围的权限会直接置灰,避免前端只给出“保存失败”的笼统提示。 - - - - {{item.group}} - - - - - - - - - - - - - - - 权限定义 - - 权限编码 - - - - 权限名称 - - - - 权限分组 - - - - 描述 - - - - - - - - diff --git a/FD-WeChat-Fronted/admin/pages/permission-form/index.wxss b/FD-WeChat-Fronted/admin/pages/permission-form/index.wxss deleted file mode 100644 index c7f2860b..00000000 --- a/FD-WeChat-Fronted/admin/pages/permission-form/index.wxss +++ /dev/null @@ -1,5 +0,0 @@ -@import "../../app.wxss"; -checkbox { - transform: scale(0.75); - margin-right: 8rpx; -} diff --git a/FD-WeChat-Fronted/admin/pages/permissions/index.js b/FD-WeChat-Fronted/admin/pages/permissions/index.js deleted file mode 100644 index 62d56530..00000000 --- a/FD-WeChat-Fronted/admin/pages/permissions/index.js +++ /dev/null @@ -1,181 +0,0 @@ -/** - * Purpose: permissionApi supports index.js by holding or executing the permission api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const permissionApi = require('../../api/permission') -/** - * Purpose: userApi supports index.js by holding or executing the user api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const userApi = require('../../api/user') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -const { setTempRecord, clearTempRecord } = require('../../utils/storage') - -/** - * Purpose: groupPermissions supports index.js by holding or executing the group permissions page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function groupPermissions(list) { - const map = {} - ;(Array.isArray(list) ? list : []).forEach(item => { - const group = item.permissionGroup || '未分组' - if (!map[group]) { - map[group] = [] - } - map[group].push(item) - }) - - return Object.keys(map).map(group => ({ - group, - items: map[group] - })) -} - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: permissionGroups supports index.js by holding or executing the permission groups page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionGroups: [], - /** - * Purpose: users supports index.js by holding or executing the users page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - users: [], - /** - * Purpose: canCreate supports index.js by holding or executing the can create page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canCreate: false, - /** - * Purpose: canAssign supports index.js by holding or executing the can assign page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canAssign: false - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入权限管理')) { - return - } - - const permissionCodes = getApp().globalData.permissionCodes || [] - this.setData({ - /** - * Purpose: canCreate supports index.js by holding or executing the can create page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canCreate: permissionCodes.includes('permission:create'), - /** - * Purpose: canAssign supports index.js by holding or executing the can assign page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canAssign: permissionCodes.includes('permission:assign') - }) - this.loadPageData() - }, - - async loadPageData() { - try { - const [permissions, users] = await Promise.all([ - permissionApi.listAllPermissions(), - userApi.listAllUsers().catch(() => []) - ]) - this.setData({ - /** - * Purpose: permissionGroups supports index.js by holding or executing the permission groups page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionGroups: groupPermissions(permissions), - /** - * Purpose: users supports index.js by holding or executing the users page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - users: Array.isArray(users) ? users : [] - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '权限数据加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleCreatePermission supports index.js by holding or executing the handle create permission page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleCreatePermission() { - clearTempRecord('currentPermission') - navigation.navigate('/pages/permission-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'definition-create' - }).catch(() => undefined) - }, - - /** - * Purpose: handleEditPermission supports index.js by holding or executing the handle edit permission page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleEditPermission(event) { - const permission = event.currentTarget.dataset.permission - setTempRecord('currentPermission', permission) - navigation.navigate('/pages/permission-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'definition-edit', - /** - * Purpose: id supports index.js by holding or executing the id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - id: permission.id - }).catch(() => undefined) - }, - - /** - * Purpose: handleAssignUser supports index.js by holding or executing the handle assign user page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleAssignUser(event) { - const user = event.currentTarget.dataset.user - setTempRecord('currentUser', user) - navigation.navigate('/pages/permission-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'assign', - /** - * Purpose: userId supports index.js by holding or executing the user id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userId: user.id - }).catch(() => undefined) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/permissions/index.json b/FD-WeChat-Fronted/admin/pages/permissions/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/permissions/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/permissions/index.wxml b/FD-WeChat-Fronted/admin/pages/permissions/index.wxml deleted file mode 100644 index 54a006cf..00000000 --- a/FD-WeChat-Fronted/admin/pages/permissions/index.wxml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 用户授权 - 移动端不再铺宽表格,先选用户,再进入分组权限页勾选保存。服务端会继续兜底拦截超范围授权。 - - - - - {{item.nickname || item.account}} - {{item.account}} · {{item.shopName || '多店铺账号'}} - - {{item.type === 4 ? '管理员' : item.type === 2 ? '店长' : item.type === 3 ? '美甲师' : '用户'}} - - - 配置权限 - - - - - - - - - 权限字典 - 当前代码真实使用的权限定义都集中在这里,便于在手机上快速检查分组和描述是否合理。 - - 新增 - - - - {{item.group}} - - - - - {{item.permissionCode}} - {{item.permissionName}} - {{item.description || '暂无描述'}} - - 编辑 - - - - - - - diff --git a/FD-WeChat-Fronted/admin/pages/permissions/index.wxss b/FD-WeChat-Fronted/admin/pages/permissions/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/permissions/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/product-form/index.js b/FD-WeChat-Fronted/admin/pages/product-form/index.js deleted file mode 100644 index 071fdc9f..00000000 --- a/FD-WeChat-Fronted/admin/pages/product-form/index.js +++ /dev/null @@ -1,830 +0,0 @@ -/** - * Purpose: productApi supports index.js by holding or executing the product api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const productApi = require('../../api/product') -/** - * Purpose: tagApi supports index.js by holding or executing the tag api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const tagApi = require('../../api/tag') -/** - * Purpose: userApi supports index.js by holding or executing the user api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const userApi = require('../../api/user') -/** - * Purpose: couponApi supports index.js by holding or executing the coupon api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const couponApi = require('../../api/coupon') -/** - * Purpose: shopApi supports index.js by holding or executing the shop api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const shopApi = require('../../api/shop') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: format supports index.js by holding or executing the format page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const format = require('../../utils/format') -/** - * Purpose: cache supports index.js by holding or executing the cache page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const cache = require('../../utils/cache') -/** - * Purpose: upload supports index.js by holding or executing the upload page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const upload = require('../../utils/upload') -const { getTempRecord, clearTempRecord } = require('../../utils/storage') -const { getDraftValue, clearDraft, scheduleDraftSave, clearDraftTimer } = require('../../utils/form-draft') -const { markDirty } = require('../../utils/page-state') -const { CACHE_TTL } = require('../../utils/config') - -/** - * Purpose: DRAFT_KEY supports index.js by holding or executing the draft key page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const DRAFT_KEY = 'admin-product-form' - -/** - * Purpose: normalizeId supports index.js by holding or executing the normalize id page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function normalizeId(value) { - return value === undefined || value === null ? '' : String(value) -} - -/** - * Purpose: buildCheckableList supports index.js by holding or executing the build checkable list page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildCheckableList(list, selectedIds, labelKey) { - return (Array.isArray(list) ? list : []).map(item => ({ - ...item, - valueId: normalizeId(item.id), - labelText: item[labelKey], - checked: selectedIds.includes(normalizeId(item.id)) - })) -} - -/** - * Purpose: syncSelectedIds supports index.js by holding or executing the sync selected ids page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function syncSelectedIds(selectedIds, list) { - const availableIds = new Set((Array.isArray(list) ? list : []).map(item => normalizeId(item.id))) - return (Array.isArray(selectedIds) ? selectedIds : []).filter(id => availableIds.has(normalizeId(id))) -} - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create', - /** - * Purpose: productId supports index.js by holding or executing the product id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - productId: '', - /** - * Purpose: shops supports index.js by holding or executing the shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shops: [], - /** - * Purpose: shopIndex supports index.js by holding or executing the shop index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopIndex: 0, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: '', - /** - * Purpose: tags supports index.js by holding or executing the tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tags: [], - /** - * Purpose: artists supports index.js by holding or executing the artists page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - artists: [], - /** - * Purpose: coupons supports index.js by holding or executing the coupons page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - coupons: [], - /** - * Purpose: uploading supports index.js by holding or executing the uploading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploading: false, - /** - * Purpose: uploadProgress supports index.js by holding or executing the upload progress page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploadProgress: 0, - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '', - /** - * Purpose: description supports index.js by holding or executing the description page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - description: '', - /** - * Purpose: targetAudience records who or which scene this product is suitable for. - * Usage: edit it in the product form and submit it with create/update payloads. - */ - targetAudience: '', - /** - * Purpose: precautions records service reminders for this product. - * Usage: edit it in the product form and submit it with create/update payloads. - */ - precautions: '', - /** - * Purpose: price supports index.js by holding or executing the price page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - price: '', - /** - * Purpose: approximateDuration supports index.js by holding or executing the approximate duration page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - approximateDuration: '', - /** - * Purpose: likeCount supports index.js by holding or executing the like count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - likeCount: '', - /** - * Purpose: collectCount supports index.js by holding or executing the collect count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - collectCount: '', - /** - * Purpose: imageFileIds supports index.js by holding or executing the image file ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - imageFileIds: [], - /** - * Purpose: shopId supports index.js by holding or executing the shop id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopId: '', - /** - * 前台展示开关,手动预约项目补全前保持隐藏。 - */ - frontVisible: 1 - } - }, - - /** - * Purpose: onLoad supports index.js by holding or executing the on load page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onLoad(options) { - const mode = options && options.mode ? options.mode : 'create' - const currentProduct = getTempRecord('currentProduct', null) - const draft = getDraftValue(DRAFT_KEY, null) - this.setData({ - mode, - /** - * Purpose: productId supports index.js by holding or executing the product id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - productId: options && options.id ? options.id : '' - }) - - this._selectedTagIds = [] - this._selectedArtistIds = [] - this._selectedCouponIds = [] - - if (mode === 'edit' && currentProduct) { - this._selectedTagIds = format.splitCsv(currentProduct.tags) - this._selectedArtistIds = format.splitCsv(currentProduct.bookableArtists) - this._selectedCouponIds = format.splitCsv(currentProduct.availableCoupons) - this._initialShopId = currentProduct.shopId - this.setData({ - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: currentProduct.title || '', - /** - * Purpose: description supports index.js by holding or executing the description page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - description: currentProduct.description || '', - /** - * Purpose: targetAudience restores the existing product suitable-audience text in edit mode. - * Usage: bind this field to the form textarea and submit it unchanged unless the operator edits it. - */ - targetAudience: currentProduct.targetAudience || '', - /** - * Purpose: precautions restores the existing product reminder text in edit mode. - * Usage: bind this field to the form textarea and submit it unchanged unless the operator edits it. - */ - precautions: currentProduct.precautions || '', - /** - * Purpose: price supports index.js by holding or executing the price page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - price: currentProduct.price || '', - /** - * Purpose: approximateDuration supports index.js by holding or executing the approximate duration page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - approximateDuration: currentProduct.approximateDuration || '', - /** - * Purpose: likeCount supports index.js by holding or executing the like count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - likeCount: currentProduct.likeCount || '', - /** - * Purpose: collectCount supports index.js by holding or executing the collect count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - collectCount: currentProduct.collectCount || '', - /** - * Purpose: imageFileIds supports index.js by holding or executing the image file ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - imageFileIds: format.splitCsv(currentProduct.imageFileIds), - /** - * Purpose: shopId supports index.js by holding or executing the shop id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopId: currentProduct.shopId || '', - /** - * 编辑时回填前台展示开关。 - */ - frontVisible: currentProduct.frontVisible === 0 ? 0 : 1 - } - }) - } - - if (draft && draft.mode === mode) { - this._selectedTagIds = Array.isArray(draft.selectedTagIds) ? draft.selectedTagIds : this._selectedTagIds - this._selectedArtistIds = Array.isArray(draft.selectedArtistIds) ? draft.selectedArtistIds : this._selectedArtistIds - this._selectedCouponIds = Array.isArray(draft.selectedCouponIds) ? draft.selectedCouponIds : this._selectedCouponIds - this._initialShopId = draft.form && draft.form.shopId ? draft.form.shopId : this._initialShopId - this.setData({ - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - ...this.data.form, - ...(draft.form || {}) - } - }) - } - - this.loadDependencies() - }, - - /** - * Purpose: onUnload supports index.js by holding or executing the on unload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onUnload() { - clearTempRecord('currentProduct') - clearDraftTimer(this) - }, - - /** - * Purpose: scheduleProductDraft supports index.js by holding or executing the schedule product draft page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - scheduleProductDraft() { - scheduleDraftSave(this, DRAFT_KEY, () => ({ - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: this.data.mode, - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - ...this.data.form, - /** - * Purpose: imageFileIds supports index.js by holding or executing the image file ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - imageFileIds: this.data.form.imageFileIds.slice() - }, - /** - * Purpose: selectedTagIds supports index.js by holding or executing the selected tag ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - selectedTagIds: this._selectedTagIds.slice(), - /** - * Purpose: selectedArtistIds supports index.js by holding or executing the selected artist ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - selectedArtistIds: this._selectedArtistIds.slice(), - /** - * Purpose: selectedCouponIds supports index.js by holding or executing the selected coupon ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - selectedCouponIds: this._selectedCouponIds.slice() - })) - }, - - async loadDependencies() { - const app = getApp() - const currentShop = app.globalData.currentShop - const operator = app.globalData.userInfo || {} - - try { - const shopList = await cache.remember('admin:shops:all', CACHE_TTL.dict, () => shopApi.listAllShops()) - - let shops = Array.isArray(shopList) ? shopList : [] - if (Number(operator.type) !== 4 && currentShop) { - shops = shops.filter(item => normalizeId(item.id) === normalizeId(currentShop.id)) - } - - let shopIndex = 0 - if (this._initialShopId) { - const index = shops.findIndex(item => normalizeId(item.id) === normalizeId(this._initialShopId)) - if (index >= 0) { - shopIndex = index - } - } - const selectedShop = shops[shopIndex] - - this.setData({ - shops, - shopIndex, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: selectedShop ? selectedShop.shopName : '', - 'form.shopId': selectedShop ? selectedShop.id : '' - }) - - await this.loadShopScopedOptions(selectedShop ? selectedShop.id : '') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '初始化作品表单失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - async loadShopScopedOptions(shopId) { - if (!normalizeId(shopId)) { - this._selectedTagIds = [] - this._selectedArtistIds = [] - this._selectedCouponIds = [] - this.setData({ - /** - * Purpose: tags supports index.js by holding or executing the tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tags: [], - /** - * Purpose: artists supports index.js by holding or executing the artists page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - artists: [], - /** - * Purpose: coupons supports index.js by holding or executing the coupons page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - coupons: [] - }) - return - } - - try { - const [tagList, artistList, couponList] = await Promise.all([ - tagApi.listTagsByShopId(shopId), - userApi.listArtists(shopId), - couponApi.listAllCoupons(shopId) - ]) - - this._selectedTagIds = syncSelectedIds(this._selectedTagIds, tagList) - this._selectedArtistIds = syncSelectedIds(this._selectedArtistIds, artistList) - this._selectedCouponIds = syncSelectedIds(this._selectedCouponIds, couponList) - - this.setData({ - /** - * Purpose: tags supports index.js by holding or executing the tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tags: buildCheckableList(tagList, this._selectedTagIds, 'tagName'), - /** - * Purpose: artists supports index.js by holding or executing the artists page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - artists: buildCheckableList(artistList, this._selectedArtistIds, 'nickname'), - /** - * Purpose: coupons supports index.js by holding or executing the coupons page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - coupons: buildCheckableList(couponList, this._selectedCouponIds, 'couponName') - }) - this.scheduleProductDraft() - } catch (error) { - this.setData({ - /** - * Purpose: tags supports index.js by holding or executing the tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tags: [], - /** - * Purpose: artists supports index.js by holding or executing the artists page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - artists: [], - /** - * Purpose: coupons supports index.js by holding or executing the coupons page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - coupons: [] - }) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '店铺关联数据加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleInputChange supports index.js by holding or executing the handle input change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleInputChange(event) { - const field = event.currentTarget.dataset.field - this.setData({ - [`form.${field}`]: event.detail.value - }) - this.scheduleProductDraft() - }, - - handleFrontVisibleChange(event) { - this.setData({ - 'form.frontVisible': event.detail.value ? 1 : 0 - }) - this.scheduleProductDraft() - }, - - /** - * Purpose: handleShopChange supports index.js by holding or executing the handle shop change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleShopChange(event) { - const shopIndex = Number(event.detail.value) - const selectedShop = this.data.shops[shopIndex] - this.setData({ - shopIndex, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: selectedShop ? selectedShop.shopName : '', - 'form.shopId': selectedShop ? selectedShop.id : '' - }) - this.loadShopScopedOptions(selectedShop ? selectedShop.id : '') - this.scheduleProductDraft() - }, - - /** - * Purpose: handleTagChange supports index.js by holding or executing the handle tag change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleTagChange(event) { - this._selectedTagIds = event.detail.value || [] - this.setData({ - /** - * Purpose: tags supports index.js by holding or executing the tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tags: this.data.tags.map(item => ({ - ...item, - /** - * Purpose: checked supports index.js by holding or executing the checked page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - checked: this._selectedTagIds.includes(item.valueId) - })) - }) - this.scheduleProductDraft() - }, - - /** - * Purpose: handleArtistChange supports index.js by holding or executing the handle artist change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleArtistChange(event) { - this._selectedArtistIds = event.detail.value || [] - this.setData({ - /** - * Purpose: artists supports index.js by holding or executing the artists page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - artists: this.data.artists.map(item => ({ - ...item, - /** - * Purpose: checked supports index.js by holding or executing the checked page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - checked: this._selectedArtistIds.includes(item.valueId) - })) - }) - this.scheduleProductDraft() - }, - - /** - * Purpose: handleCouponChange supports index.js by holding or executing the handle coupon change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleCouponChange(event) { - this._selectedCouponIds = event.detail.value || [] - this.setData({ - /** - * Purpose: coupons supports index.js by holding or executing the coupons page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - coupons: this.data.coupons.map(item => ({ - ...item, - /** - * Purpose: checked supports index.js by holding or executing the checked page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - checked: this._selectedCouponIds.includes(item.valueId) - })) - }) - this.scheduleProductDraft() - }, - - async handleUploadImages() { - try { - const files = await upload.chooseImageFiles({ count: 9 }) - this.setData({ - /** - * Purpose: uploading supports index.js by holding or executing the uploading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploading: true, - /** - * Purpose: uploadProgress supports index.js by holding or executing the upload progress page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploadProgress: 0 - }) - const result = await upload.uploadImageFiles({ - files, - /** - * Purpose: scene supports index.js by holding or executing the scene page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - scene: 'admin-product-image', - /** - * Purpose: onProgress supports index.js by holding or executing the on progress page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - onProgress: progress => { - this.setData({ - /** - * Purpose: uploadProgress supports index.js by holding or executing the upload progress page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploadProgress: Math.round(progress) - }) - } - }) - - this.setData({ - 'form.imageFileIds': this.data.form.imageFileIds.concat(result.map(item => String(item.id))) - }) - this.scheduleProductDraft() - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '图片上传失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } finally { - this.setData({ - /** - * Purpose: uploading supports index.js by holding or executing the uploading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploading: false - }) - } - }, - - async handleSubmit() { - if (!this.data.form.title) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '请输入作品标题', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - if (!this.data.form.shopId) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '请选择所属店铺', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - if (!this.data.form.price) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '请输入作品价格', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - - const payload = { - /** - * Purpose: shopId supports index.js by holding or executing the shop id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopId: this.data.form.shopId || undefined, - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: this.data.form.title, - /** - * Purpose: description supports index.js by holding or executing the description page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - description: this.data.form.description || undefined, - /** - * Purpose: targetAudience sends the optional suitable-audience text to the backend. - * Usage: leave it undefined when empty so old products can hide the section on user detail pages. - */ - targetAudience: this.data.form.targetAudience || undefined, - /** - * Purpose: precautions sends the optional reminder text to the backend. - * Usage: leave it undefined when empty so old products can hide the section on user detail pages. - */ - precautions: this.data.form.precautions || undefined, - /** - * Purpose: imageFileIds supports index.js by holding or executing the image file ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - imageFileIds: this.data.form.imageFileIds.join(',') || undefined, - /** - * Purpose: price supports index.js by holding or executing the price page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - price: Number(this.data.form.price), - /** - * Purpose: tags supports index.js by holding or executing the tags page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tags: this._selectedTagIds.join(',') || undefined, - /** - * Purpose: likeCount supports index.js by holding or executing the like count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - likeCount: this.data.form.likeCount ? Number(this.data.form.likeCount) : undefined, - /** - * Purpose: collectCount supports index.js by holding or executing the collect count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - collectCount: this.data.form.collectCount ? Number(this.data.form.collectCount) : undefined, - /** - * Purpose: approximateDuration supports index.js by holding or executing the approximate duration page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - approximateDuration: this.data.form.approximateDuration || undefined, - /** - * Purpose: bookableArtists supports index.js by holding or executing the bookable artists page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - bookableArtists: this._selectedArtistIds.join(',') || undefined, - /** - * Purpose: availableCoupons supports index.js by holding or executing the available coupons page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - availableCoupons: this._selectedCouponIds.join(',') || undefined, - /** - * 后台补全后可手动发布到用户端。 - */ - frontVisible: this.data.form.frontVisible === 0 ? 0 : 1 - } - - try { - if (this.data.mode === 'edit') { - await productApi.updateProduct(this.data.productId, payload) - } else { - await productApi.createProduct(payload) - } - clearDraft(DRAFT_KEY) - markDirty('admin-products') - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: this.data.mode === 'edit' ? '作品已更新' : '作品已创建', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - navigation.goBack('/pages/products/index') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '保存失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/product-form/index.json b/FD-WeChat-Fronted/admin/pages/product-form/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/product-form/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/product-form/index.wxml b/FD-WeChat-Fronted/admin/pages/product-form/index.wxml deleted file mode 100644 index 0b9789cb..00000000 --- a/FD-WeChat-Fronted/admin/pages/product-form/index.wxml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - 作品信息 - - 作品标题 - - - - 所属店铺 - - {{shopLabel || '请选择店铺'}} - - - - 作品价格 - - - - 大约耗时 - - - - 作品描述 - - - - 适合人群 - - - - 注意事项 - - - - 点赞数量 - - - - 收藏数量 - - - - - 前台展示 - - - - - - 作品图片 - - 上传图片 - - - - {{item}} - - - - - - 绑定标签 - - - - - - - - - 可预约美甲师 - - - - - - - - - 可用优惠券 - - - - - - - - 图片上传中,当前进度 {{uploadProgress}}% - - - - - - diff --git a/FD-WeChat-Fronted/admin/pages/product-form/index.wxss b/FD-WeChat-Fronted/admin/pages/product-form/index.wxss deleted file mode 100644 index da1707db..00000000 --- a/FD-WeChat-Fronted/admin/pages/product-form/index.wxss +++ /dev/null @@ -1,12 +0,0 @@ -@import "../../app.wxss"; -checkbox { - transform: scale(0.75); - margin-right: 8rpx; -} - -.switch-field { - display: flex; - align-items: center; - justify-content: space-between; - gap: 24rpx; -} diff --git a/FD-WeChat-Fronted/admin/pages/products/index.js b/FD-WeChat-Fronted/admin/pages/products/index.js deleted file mode 100644 index 6c9a73ae..00000000 --- a/FD-WeChat-Fronted/admin/pages/products/index.js +++ /dev/null @@ -1,292 +0,0 @@ -/** - * Purpose: productApi supports index.js by holding or executing the product api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const productApi = require('../../api/product') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: format supports index.js by holding or executing the format page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const format = require('../../utils/format') -const { setTempRecord, clearTempRecord } = require('../../utils/storage') -const { consumeDirty } = require('../../utils/page-state') - -/** - * Purpose: PAGE_KEY supports index.js by holding or executing the page key page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const PAGE_KEY = 'admin-products' - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: '', - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: [], - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false, - /** - * Purpose: canCreate supports index.js by holding or executing the can create page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canCreate: false, - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: false - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入作品管理')) { - return - } - - const permissionCodes = getApp().globalData.permissionCodes || [] - this.setData({ - /** - * Purpose: canCreate supports index.js by holding or executing the can create page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canCreate: permissionCodes.includes('product:create') - }) - - if (!this.data.initialized || consumeDirty(PAGE_KEY)) { - this.loadProducts() - } - }, - - /** - * Purpose: handleKeywordInput supports index.js by holding or executing the handle keyword input page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleKeywordInput(event) { - this.setData({ - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: event.detail.value - }) - }, - - /** - * Purpose: handleSearch supports index.js by holding or executing the handle search page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleSearch() { - this.loadProducts() - }, - - async loadProducts() { - const requestId = (this._loadRequestId || 0) + 1 - this._loadRequestId = requestId - this.setData({ - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: true - }) - - try { - const result = await productApi.listProducts({ - /** - * Purpose: page supports index.js by holding or executing the page page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - page: 1, - /** - * Purpose: size supports index.js by holding or executing the size page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - size: 20, - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: this.data.keyword || undefined - }) - if (requestId !== this._loadRequestId) { - return - } - - this.setData({ - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: (Array.isArray(result && result.list) ? result.list : []).map(item => ({ - ...item, - /** - * Purpose: displayPrice supports index.js by holding or executing the display price page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayPrice: format.formatPrice(item.price), - /** - * Purpose: displayShopName supports index.js by holding or executing the display shop name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayShopName: item.shopName || '当前店铺', - /** - * Purpose: displayDuration supports index.js by holding or executing the display duration page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayDuration: item.approximateDuration || '未设置时长', - /** - * Purpose: displayTagText supports index.js by holding or executing the display tag text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayTagText: Array.isArray(item.tagList) ? item.tagList.join(' / ') : (item.tags || '未设置标签') - })), - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: true - }) - } catch (error) { - if (requestId !== this._loadRequestId) { - return - } - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '作品列表加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } finally { - if (requestId === this._loadRequestId) { - this.setData({ - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false - }) - } - } - }, - - /** - * Purpose: handleCreate supports index.js by holding or executing the handle create page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleCreate() { - clearTempRecord('currentProduct') - navigation.navigate('/pages/product-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create' - }).catch(() => undefined) - }, - - /** - * Purpose: handleEdit supports index.js by holding or executing the handle edit page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleEdit(event) { - const product = event.currentTarget.dataset.product - setTempRecord('currentProduct', product) - navigation.navigate('/pages/product-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'edit', - /** - * Purpose: id supports index.js by holding or executing the id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - id: product.id - }).catch(() => undefined) - }, - - /** - * Purpose: handleDelete supports index.js by holding or executing the handle delete page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleDelete(event) { - const product = event.currentTarget.dataset.product - wx.showModal({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '删除作品', - /** - * Purpose: content supports index.js by holding or executing the content page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - content: `确认删除作品“${product.title}”吗?`, - /** - * Purpose: success supports index.js by holding or executing the success page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - success: async result => { - if (!result.confirm) { - return - } - try { - await productApi.deleteProduct(product.id) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '作品已删除', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - this.loadProducts() - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '作品删除失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } - }) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/products/index.json b/FD-WeChat-Fronted/admin/pages/products/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/products/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/products/index.wxml b/FD-WeChat-Fronted/admin/pages/products/index.wxml deleted file mode 100644 index 5c72da57..00000000 --- a/FD-WeChat-Fronted/admin/pages/products/index.wxml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 作品列表 - - - - - - - - - - - {{item.title}} - {{item.displayShopName}} · {{item.displayDuration}} - - ¥{{item.displayPrice}} - - - - 标签 - {{item.displayTagText}} - - - 点赞 / 收藏 - {{item.likeCount || 0}} / {{item.collectCount || 0}} - - - - 编辑 - 删除 - - - - - - 正在加载作品列表 - - - - 还没有作品 - 先上传图片、绑定标签和美甲师后,就可以把完整作品发布到门店里。 - - - + - - diff --git a/FD-WeChat-Fronted/admin/pages/products/index.wxss b/FD-WeChat-Fronted/admin/pages/products/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/products/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/profile/index.js b/FD-WeChat-Fronted/admin/pages/profile/index.js deleted file mode 100644 index b0ee343e..00000000 --- a/FD-WeChat-Fronted/admin/pages/profile/index.js +++ /dev/null @@ -1,251 +0,0 @@ -/** - * Purpose: authApi supports index.js by holding or executing the auth api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const authApi = require('../../api/auth') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: permission supports index.js by holding or executing the permission page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const permission = require('../../utils/permission') -const sessionSwitch = require('../../../utils/session-switch') - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: userInfo supports index.js by holding or executing the user info page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userInfo: null, - /** - * Purpose: currentShop supports index.js by holding or executing the current shop page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - currentShop: null, - /** - * Purpose: permissionCodes supports index.js by holding or executing the permission codes page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionCodes: [], - /** - * Purpose: roleLabel supports index.js by holding or executing the role label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - roleLabel: '', - /** - * Purpose: shopScopeText supports index.js by holding or executing the shop scope text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopScopeText: '', - /** - * Purpose: currentShopText supports index.js by holding or executing the current shop text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - currentShopText: '' - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入个人中心')) { - return - } - - const app = getApp() - const userInfo = app.globalData.userInfo - const currentShop = app.globalData.currentShop - const shopScopeText = userInfo - ? (Array.isArray(userInfo.shopNames) && userInfo.shopNames.length - ? userInfo.shopNames.join(' / ') - : (userInfo.shopName || '--')) - : '--' - - this.setData({ - userInfo, - currentShop, - /** - * Purpose: permissionCodes supports index.js by holding or executing the permission codes page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionCodes: app.globalData.permissionCodes || [], - /** - * Purpose: roleLabel supports index.js by holding or executing the role label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - roleLabel: userInfo ? permission.getRoleLabel(userInfo.type) : '--', - shopScopeText, - /** - * Purpose: currentShopText supports index.js by holding or executing the current shop text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - currentShopText: currentShop ? `当前店铺:${currentShop.shopName}` : '当前为平台总览模式' - }) - }, - - /** - * Purpose: handleOpenOrders supports index.js by holding or executing the handle open orders page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleOpenOrders() { - navigation.switchTab('/pages/orders/index').catch(() => undefined) - }, - - /** - * Purpose: handleOpenManage supports index.js by holding or executing the handle open manage page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleOpenManage() { - navigation.switchTab('/pages/manage/index').catch(() => undefined) - }, - - handleOpenWorkbench() { - navigation.switchTab('/pages/workbench/index').catch(() => undefined) - }, - - handleOpenCustomerHome() { - sessionSwitch.openCustomerHome() - }, - - async handleSwitchShop() { - const userInfo = this.data.userInfo - if (!userInfo || !userInfo.account) { - return - } - - try { - const result = await authApi.getLoginShops(userInfo.account) - const shops = Array.isArray(result && result.shops) ? result.shops : [] - const allowShoplessLogin = Boolean(result && result.allowShoplessLogin) - if (allowShoplessLogin && permission.isPlatformAdmin(userInfo)) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '平台管理员固定为总览模式', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - const items = shops.map(shop => ({ - /** - * Purpose: label supports index.js by holding or executing the label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - label: shop.shopName, - /** - * Purpose: value supports index.js by holding or executing the value page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - value: shop.id - })) - - if (!items.length) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '当前账号没有可切换的店铺', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - - wx.showActionSheet({ - /** - * Purpose: itemList supports index.js by holding or executing the item list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - itemList: items.map(item => item.label), - /** - * Purpose: success supports index.js by holding or executing the success page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - success: async action => { - const target = items[action.tapIndex] - if (!target) { - return - } - - try { - await getApp().switchAdminShop(target.value || undefined) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '店铺已切换', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - this.onShow() - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '切换店铺失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '店铺列表加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - async handleLogout() { - try { - await authApi.logout().catch(() => undefined) - } finally { - getApp().clearAdminSession() - wx.reLaunch({ - /** - * Purpose: url supports index.js by holding or executing the url page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - url: '/admin/pages/login/index' - }) - } - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/profile/index.json b/FD-WeChat-Fronted/admin/pages/profile/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/profile/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/profile/index.wxml b/FD-WeChat-Fronted/admin/pages/profile/index.wxml deleted file mode 100644 index 7a96cb95..00000000 --- a/FD-WeChat-Fronted/admin/pages/profile/index.wxml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - {{userInfo.account || '后台账号'}} - {{userInfo.nickname || '未设置昵称'}} - 当前角色:{{roleLabel}}。{{currentShopText}} - - - - 账号信息 - - - 账号 - {{userInfo.account || '--'}} - - - 权限数 - {{permissionCodes.length}} - - - 店铺状态 - {{currentShop ? currentShop.shopName : '平台总览模式'}} - - - 可登录店铺 - {{shopScopeText}} - - - - - - - - - 常用入口 - - 查看订单 - 经营模块 - - - - - 退出登录 - 退出后会清理管理端会话、当前店铺和权限快照;再次进入需要重新登录。 - - - - - - - 工作台 - 订单 - 经营 - 我的 - - - 返回前台 - - diff --git a/FD-WeChat-Fronted/admin/pages/profile/index.wxss b/FD-WeChat-Fronted/admin/pages/profile/index.wxss deleted file mode 100644 index 46a60ffb..00000000 --- a/FD-WeChat-Fronted/admin/pages/profile/index.wxss +++ /dev/null @@ -1,14 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} - -.customer-switch-link { - display: flex; - align-items: center; - justify-content: center; - min-height: 72rpx; - color: #f7dba7; - font-size: 26rpx; - font-weight: 700; -} diff --git a/FD-WeChat-Fronted/admin/pages/schedules/index.js b/FD-WeChat-Fronted/admin/pages/schedules/index.js deleted file mode 100644 index 9fbc3a60..00000000 --- a/FD-WeChat-Fronted/admin/pages/schedules/index.js +++ /dev/null @@ -1,187 +0,0 @@ -const scheduleApi = require('../../api/artist-schedule') -const navigation = require('../../utils/navigation') -const permission = require('../../utils/permission') -const format = require('../../utils/format') -const { markDirty } = require('../../utils/page-state') - -function todayText(offset) { - const date = new Date() - date.setDate(date.getDate() + (offset || 0)) - const month = String(date.getMonth() + 1).padStart(2, '0') - const day = String(date.getDate()).padStart(2, '0') - return `${date.getFullYear()}-${month}-${day}` -} - -function safeList(value) { - return Array.isArray(value) ? value : [] -} - -Page({ - data: { - loading: false, - list: [], - startDate: todayText(0), - endDate: todayText(6), - artistId: '', - canEdit: false, - form: { - artistId: '', - workDate: todayText(0), - startTime: '10:00', - endTime: '18:00', - slotMinutes: '60', - capacity: '1', - remark: '' - } - }, - - onShow() { - if (!navigation.ensureLogin('进入排班管理')) { - return - } - const permissionCodes = getApp().globalData.permissionCodes || [] - this.setData({ - canEdit: permission.hasPermission(permissionCodes, 'schedule:edit') - }) - this.loadSchedules() - }, - - onPullDownRefresh() { - this.loadSchedules().finally(() => { - wx.stopPullDownRefresh() - }) - }, - - buildQuery() { - const query = {} - ;['artistId', 'startDate', 'endDate'].forEach(key => { - const value = String(this.data[key] || '').trim() - if (value) { - query[key] = value - } - }) - return query - }, - - async loadSchedules() { - this.setData({ loading: true }) - try { - const list = await scheduleApi.listSchedules(this.buildQuery()) - this.setData({ - list: safeList(list).map(item => this.formatSchedule(item)) - }) - } catch (error) { - wx.showToast({ - title: error.message || '排班加载失败', - icon: 'none' - }) - } finally { - this.setData({ loading: false }) - } - }, - - formatSchedule(item) { - const startTime = String(item.startTime || '').slice(0, 5) - const endTime = String(item.endTime || '').slice(0, 5) - return { - ...item, - displayDate: format.formatDate(item.workDate), - displayTime: `${startTime || '--'} - ${endTime || '--'}`, - statusText: Number(item.status) === 0 ? '停用' : '可预约' - } - }, - - handleArtistInput(event) { - this.setData({ artistId: event.detail.value }) - }, - - handleStartDateChange(event) { - this.setData({ startDate: event.detail.value }) - this.loadSchedules() - }, - - handleEndDateChange(event) { - this.setData({ endDate: event.detail.value }) - this.loadSchedules() - }, - - handleSearch() { - this.loadSchedules() - }, - - handleFormInput(event) { - const field = event.currentTarget.dataset.field - if (!field) { - return - } - this.setData({ - [`form.${field}`]: event.detail.value - }) - }, - - handleFormDateChange(event) { - this.setData({ - 'form.workDate': event.detail.value - }) - }, - - handleFormStartTimeChange(event) { - this.setData({ - 'form.startTime': event.detail.value - }) - }, - - handleFormEndTimeChange(event) { - this.setData({ - 'form.endTime': event.detail.value - }) - }, - - async handleSaveSchedule() { - if (!this.data.canEdit) { - wx.showToast({ - title: '当前账号没有编辑排班权限', - icon: 'none' - }) - return - } - - const form = this.data.form - const artistId = String(form.artistId || '').trim() - if (!artistId) { - wx.showToast({ - title: '请填写美甲师 ID', - icon: 'none' - }) - return - } - - try { - await scheduleApi.saveSchedule({ - artistId, - workDate: form.workDate, - startTime: form.startTime, - endTime: form.endTime, - slotMinutes: Number(form.slotMinutes) || 60, - capacity: Number(form.capacity) || 1, - status: 1, - remark: String(form.remark || '').trim() - }) - markDirty('admin-workbench') - wx.showToast({ - title: '排班已保存', - icon: 'none' - }) - this.loadSchedules() - } catch (error) { - wx.showToast({ - title: error.message || '排班保存失败', - icon: 'none' - }) - } - }, - - handleBack() { - navigation.goBack('/pages/manage/index') - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/schedules/index.json b/FD-WeChat-Fronted/admin/pages/schedules/index.json deleted file mode 100644 index 696ffd1c..00000000 --- a/FD-WeChat-Fronted/admin/pages/schedules/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - }, - "enablePullDownRefresh": true -} diff --git a/FD-WeChat-Fronted/admin/pages/schedules/index.wxml b/FD-WeChat-Fronted/admin/pages/schedules/index.wxml deleted file mode 100644 index 1040a227..00000000 --- a/FD-WeChat-Fronted/admin/pages/schedules/index.wxml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - Schedule - 门店排班 - 按日期和美甲师查看可约班次,支持店长和管理员快速补录当天班次。 - - - - 筛选 - - - - {{startDate || '开始日期'}} - - - {{endDate || '结束日期'}} - - - - - - - 快速补班 - - - - {{form.workDate}} - - - {{form.startTime}} - - - {{form.endTime}} - - - - - - - - - - - - - {{item.displayDate}} · 美甲师 {{item.artistId}} - {{item.displayTime}} · {{item.slotMinutes || 60}} 分钟/档 · 容量 {{item.capacity || 1}} - - {{item.statusText}} - - {{item.remark}} - - - - - 暂无排班 - 当前日期范围没有可展示班次。 - - - diff --git a/FD-WeChat-Fronted/admin/pages/schedules/index.wxss b/FD-WeChat-Fronted/admin/pages/schedules/index.wxss deleted file mode 100644 index fd2c4f95..00000000 --- a/FD-WeChat-Fronted/admin/pages/schedules/index.wxss +++ /dev/null @@ -1,27 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} - -.compact-field, -.compact-btn, -.compact-textarea { - margin-top: 16rpx; -} - -.filter-row picker, -.form-grid picker { - flex: 1; - min-width: 0; -} - -.form-grid { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 14rpx; - margin-top: 18rpx; -} - -.compact-textarea { - min-height: 140rpx; -} diff --git a/FD-WeChat-Fronted/admin/pages/security-audit/index.js b/FD-WeChat-Fronted/admin/pages/security-audit/index.js deleted file mode 100644 index 7feda3c7..00000000 --- a/FD-WeChat-Fronted/admin/pages/security-audit/index.js +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Purpose: auditApi reads immutable high-risk operation audit logs for admin review. - * Usage: call listLogs with filter and pagination params from this page. - */ -const auditApi = require('../../api/security-audit') -/** - * Purpose: navigation centralizes page transitions and fallback back behavior. - * Usage: call goBack when the custom navigation bar back event fires. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: format prepares backend timestamps for compact mini-program display. - * Usage: call formatDateTime before assigning audit rows to page data. - */ -const format = require('../../utils/format') - -/** - * Purpose: RESULT_OPTIONS drives the audit result segmented filter. - * Usage: keep values aligned with backend result strings accepted by /admin/security-audit/logs. - */ -const RESULT_OPTIONS = [ - { label: '全部', value: '' }, - { label: '成功', value: 'SUCCESS' }, - { label: '失败', value: 'FAIL' } -] - -Page({ - /** - * Purpose: data stores filter, pagination, and rendered audit rows for the read-only audit page. - * Usage: WXML binds these fields and page methods update them through setData. - */ - data: { - /** - * Purpose: loading indicates whether an audit-log query is currently in flight. - * Usage: bind it to the search button and bottom loader to prevent duplicate requests. - */ - loading: false, - /** - * Purpose: list holds formatted audit log rows returned by the backend. - * Usage: append or replace it after listLogs responses. - */ - list: [], - /** - * Purpose: page tracks the current backend page number. - * Usage: increment it only after a successful load-more response. - */ - page: 1, - /** - * Purpose: size controls how many audit rows each request asks for. - * Usage: pass it unchanged to listLogs so paging remains stable. - */ - size: 10, - /** - * Purpose: hasMore tells the page whether another backend page is available. - * Usage: set it from response totals and guard onReachBottom. - */ - hasMore: true, - /** - * Purpose: account filters audit logs by operator account. - * Usage: bind it to the search input and pass non-empty values to the API. - */ - account: '', - /** - * Purpose: action filters audit logs by action code or action keyword. - * Usage: bind it to the search input and pass non-empty values to the API. - */ - action: '', - /** - * Purpose: result filters audit logs by success or failure status. - * Usage: update it from result chips and pass it to the backend query. - */ - result: '', - /** - * Purpose: resultOptions renders available result filter chips. - * Usage: iterate it in WXML and compare each option value with data.result. - */ - resultOptions: RESULT_OPTIONS - }, - - /** - * Purpose: onLoad performs the initial audit-log query for authorized users. - * Usage: mini-program runtime calls it once when the page is opened from Manage. - */ - onLoad() { - this.loadLogs(true) - }, - - /** - * Purpose: onPullDownRefresh reloads the first audit-log page after manual refresh. - * Usage: mini-program runtime calls it and the method stops the refresh animation after completion. - */ - async onPullDownRefresh() { - await this.loadLogs(true) - wx.stopPullDownRefresh() - }, - - /** - * Purpose: onReachBottom loads the next page when the operator scrolls to the bottom. - * Usage: mini-program runtime calls it and the method respects loading and hasMore guards. - */ - onReachBottom() { - if (!this.data.loading && this.data.hasMore) { - this.loadLogs(false) - } - }, - - /** - * Purpose: buildQuery creates a clean backend query object from page filters and pagination. - * Usage: call it before listLogs so empty filters are not sent. - */ - buildQuery(page) { - const query = { - page, - size: this.data.size - } - ;['account', 'action', 'result'].forEach(key => { - const value = String(this.data[key] || '').trim() - if (value) { - query[key] = value - } - }) - return query - }, - - /** - * Purpose: loadLogs queries audit logs and updates list pagination state. - * Usage: pass true for a fresh search and false for infinite-scroll loading. - */ - async loadLogs(reset) { - if (this.data.loading) { - return - } - const nextPage = reset ? 1 : this.data.page + 1 - this.setData({ loading: true }) - try { - const response = await auditApi.listLogs(this.buildQuery(nextPage)) - const records = Array.isArray(response && response.records) - ? response.records - : (Array.isArray(response && response.list) ? response.list : []) - const total = Number(response && response.total) || 0 - const currentList = reset ? [] : this.data.list - const list = currentList.concat(records.map(item => this.formatLog(item))) - this.setData({ - list, - page: nextPage, - hasMore: total ? list.length < total : records.length >= this.data.size - }) - } catch (error) { - wx.showToast({ - title: error.message || '审计日志加载失败', - icon: 'none' - }) - } finally { - this.setData({ loading: false }) - } - }, - - /** - * Purpose: formatLog normalizes one backend audit row for compact display. - * Usage: call it on every record returned from listLogs before rendering. - */ - formatLog(item) { - return { - ...item, - displayTime: format.formatDateTime(item.operateTime || item.createTime), - resultText: item.result === 'SUCCESS' ? '成功' : '失败', - resultClass: item.result === 'SUCCESS' ? 'success' : 'fail', - operatorText: item.account || item.operatorAccount || '--', - reasonText: item.reason || item.failureReason || item.errorMessage || item.remark || '' - } - }, - - /** - * Purpose: handleAccountInput updates the operator-account filter as the input changes. - * Usage: bind it to the account input field. - */ - handleAccountInput(event) { - this.setData({ account: event.detail.value }) - }, - - /** - * Purpose: handleActionInput updates the action-code filter as the input changes. - * Usage: bind it to the action input field. - */ - handleActionInput(event) { - this.setData({ action: event.detail.value }) - }, - - /** - * Purpose: handleResultChange switches between all, success, and fail filters. - * Usage: bind it to result chips with data-result. - */ - handleResultChange(event) { - this.setData({ result: event.currentTarget.dataset.result || '' }) - this.loadLogs(true) - }, - - /** - * Purpose: handleSearch reloads logs using the current text filters. - * Usage: bind it to keyboard confirm and the search button. - */ - handleSearch() { - this.loadLogs(true) - }, - - /** - * Purpose: handleReset clears filters and reloads the first audit-log page. - * Usage: bind it to the reset button in the filter card. - */ - handleReset() { - this.setData({ - account: '', - action: '', - result: '' - }) - this.loadLogs(true) - }, - - /** - * Purpose: handleBack returns to Manage when this page is opened as a standalone stack page. - * Usage: bind it to the custom navigation bar back event. - */ - handleBack() { - navigation.goBack('/pages/manage/index') - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/security-audit/index.json b/FD-WeChat-Fronted/admin/pages/security-audit/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/security-audit/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/security-audit/index.wxml b/FD-WeChat-Fronted/admin/pages/security-audit/index.wxml deleted file mode 100644 index de0d6588..00000000 --- a/FD-WeChat-Fronted/admin/pages/security-audit/index.wxml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - Security Audit - 高危操作留痕 - 按账号、动作和结果查看后台关键操作记录,失败原因会保留在详情行中。 - - - - 筛选 - - - - - {{item.label}} - - - - - - - - - - - - - {{item.action || '--'}} - {{item.operatorText}} · {{item.displayTime}} - - {{item.resultText}} - - - - 业务类型 - {{item.businessType || '--'}} - - - 业务 ID - {{item.businessId || '--'}} - - - IP - {{item.ipAddress || '--'}} - - - 原因 - {{item.reasonText || '无'}} - - - - - - - 暂无审计日志 - 当前筛选条件下没有高危操作记录。 - - - 加载中... - 已加载全部 - - diff --git a/FD-WeChat-Fronted/admin/pages/security-audit/index.wxss b/FD-WeChat-Fronted/admin/pages/security-audit/index.wxss deleted file mode 100644 index 4550e4a3..00000000 --- a/FD-WeChat-Fronted/admin/pages/security-audit/index.wxss +++ /dev/null @@ -1,36 +0,0 @@ -@import "../../app.wxss"; -.field-input { - margin-top: 16rpx; -} - -.actions-row { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 16rpx; - margin-top: 20rpx; -} - -.audit-badge { - flex-shrink: 0; - padding: 8rpx 14rpx; - border-radius: 8rpx; - font-size: 22rpx; - font-weight: 700; -} - -.audit-badge.success { - color: #73d99f; - background: rgba(115, 217, 159, 0.12); -} - -.audit-badge.fail { - color: #ff9b8b; - background: rgba(255, 155, 139, 0.14); -} - -.loading-line { - color: #7e8f8c; - font-size: 24rpx; - text-align: center; - padding: 24rpx 0; -} diff --git a/FD-WeChat-Fronted/admin/pages/shop-form/index.js b/FD-WeChat-Fronted/admin/pages/shop-form/index.js deleted file mode 100644 index 3a5de602..00000000 --- a/FD-WeChat-Fronted/admin/pages/shop-form/index.js +++ /dev/null @@ -1,423 +0,0 @@ -/** - * Purpose: shopApi supports index.js by holding or executing the shop api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const shopApi = require('../../api/shop') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: upload supports index.js by holding or executing the upload page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const upload = require('../../utils/upload') -const { getTempRecord, clearTempRecord } = require('../../utils/storage') -const { getDraftValue, clearDraft, scheduleDraftSave, clearDraftTimer } = require('../../utils/form-draft') -const { markDirty } = require('../../utils/page-state') - -/** - * Purpose: DRAFT_KEY supports index.js by holding or executing the draft key page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const DRAFT_KEY = 'admin-shop-form' - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create', - /** - * Purpose: shopId supports index.js by holding or executing the shop id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopId: '', - /** - * Purpose: uploading supports index.js by holding or executing the uploading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploading: false, - /** - * Purpose: uploadProgress supports index.js by holding or executing the upload progress page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploadProgress: 0, - /** - * Purpose: statusOptions supports index.js by holding or executing the status options page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - statusOptions: ['启用', '停用'], - /** - * Purpose: statusIndex supports index.js by holding or executing the status index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - statusIndex: 0, - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: shopName supports index.js by holding or executing the shop name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopName: '', - /** - * Purpose: description supports index.js by holding or executing the description page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - description: '', - /** - * Purpose: address supports index.js by holding or executing the address page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - address: '', - /** - * Purpose: businessHours supports index.js by holding or executing the business hours page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - businessHours: '', - /** - * Purpose: coverImageFileId supports index.js by holding or executing the cover image file id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - coverImageFileId: '', - /** - * Purpose: imageFileIds supports index.js by holding or executing the image file ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - imageFileIds: [] - } - }, - - /** - * Purpose: onLoad supports index.js by holding or executing the on load page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onLoad(options) { - const mode = options && options.mode ? options.mode : 'create' - const currentShop = getTempRecord('currentShopRecord', null) - const draft = getDraftValue(DRAFT_KEY, null) - - this.setData({ - mode, - /** - * Purpose: shopId supports index.js by holding or executing the shop id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopId: options && options.id ? options.id : '' - }) - - if (mode === 'edit' && currentShop) { - this.setData({ - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: shopName supports index.js by holding or executing the shop name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopName: currentShop.shopName || '', - /** - * Purpose: description supports index.js by holding or executing the description page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - description: currentShop.description || '', - /** - * Purpose: address supports index.js by holding or executing the address page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - address: currentShop.address || '', - /** - * Purpose: businessHours supports index.js by holding or executing the business hours page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - businessHours: currentShop.businessHours || '', - /** - * Purpose: coverImageFileId supports index.js by holding or executing the cover image file id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - coverImageFileId: currentShop.coverImageFileId || '', - /** - * Purpose: imageFileIds supports index.js by holding or executing the image file ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - imageFileIds: currentShop.imageFileIds ? String(currentShop.imageFileIds).split(',').filter(Boolean) : [] - }, - /** - * Purpose: statusIndex supports index.js by holding or executing the status index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - statusIndex: Number(currentShop.status) === 0 ? 1 : 0 - }) - } - - if (draft && draft.mode === mode) { - this.setData({ - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - ...this.data.form, - ...draft.form - }, - /** - * Purpose: statusIndex supports index.js by holding or executing the status index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - statusIndex: draft.statusIndex === 1 ? 1 : this.data.statusIndex - }) - } - }, - - /** - * Purpose: onUnload supports index.js by holding or executing the on unload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onUnload() { - clearTempRecord('currentShopRecord') - clearDraftTimer(this) - }, - - /** - * Purpose: scheduleShopDraft supports index.js by holding or executing the schedule shop draft page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - scheduleShopDraft() { - scheduleDraftSave(this, DRAFT_KEY, () => ({ - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: this.data.mode, - /** - * Purpose: statusIndex supports index.js by holding or executing the status index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - statusIndex: this.data.statusIndex, - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - ...this.data.form, - /** - * Purpose: imageFileIds supports index.js by holding or executing the image file ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - imageFileIds: this.data.form.imageFileIds.slice() - } - })) - }, - - /** - * Purpose: handleInputChange supports index.js by holding or executing the handle input change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleInputChange(event) { - const field = event.currentTarget.dataset.field - this.setData({ - [`form.${field}`]: event.detail.value - }) - this.scheduleShopDraft() - }, - - /** - * Purpose: handleStatusChange supports index.js by holding or executing the handle status change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleStatusChange(event) { - this.setData({ - /** - * Purpose: statusIndex supports index.js by holding or executing the status index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - statusIndex: Number(event.detail.value) - }) - this.scheduleShopDraft() - }, - - async handleUploadBanner() { - await this.handleUpload('admin-shop-banner', true) - }, - - async handleUploadImages() { - await this.handleUpload('admin-shop-image', false) - }, - - async handleUpload(scene, isBanner) { - try { - const files = await upload.chooseImageFiles({ - /** - * Purpose: count supports index.js by holding or executing the count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - count: isBanner ? 1 : 9 - }) - this.setData({ - /** - * Purpose: uploading supports index.js by holding or executing the uploading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploading: true, - /** - * Purpose: uploadProgress supports index.js by holding or executing the upload progress page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploadProgress: 0 - }) - const results = await upload.uploadImageFiles({ - files, - scene, - /** - * Purpose: onProgress supports index.js by holding or executing the on progress page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - onProgress: progress => { - this.setData({ - /** - * Purpose: uploadProgress supports index.js by holding or executing the upload progress page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploadProgress: Math.round(progress) - }) - } - }) - - if (isBanner) { - this.setData({ - 'form.coverImageFileId': results[0] ? String(results[0].id) : '' - }) - } else { - this.setData({ - 'form.imageFileIds': this.data.form.imageFileIds.concat(results.map(item => String(item.id))) - }) - } - this.scheduleShopDraft() - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '图片上传失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } finally { - this.setData({ - /** - * Purpose: uploading supports index.js by holding or executing the uploading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - uploading: false - }) - } - }, - - async handleSubmit() { - if (!this.data.form.shopName) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '请输入店铺名称', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - - const payload = { - /** - * Purpose: shopName supports index.js by holding or executing the shop name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopName: this.data.form.shopName, - /** - * Purpose: description supports index.js by holding or executing the description page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - description: this.data.form.description || undefined, - /** - * Purpose: address supports index.js by holding or executing the address page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - address: this.data.form.address || undefined, - /** - * Purpose: businessHours supports index.js by holding or executing the business hours page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - businessHours: this.data.form.businessHours || undefined, - /** - * Purpose: coverImageFileId supports index.js by holding or executing the cover image file id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - coverImageFileId: this.data.form.coverImageFileId || undefined, - /** - * Purpose: imageFileIds supports index.js by holding or executing the image file ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - imageFileIds: this.data.form.imageFileIds.join(',') || undefined, - /** - * Purpose: status supports index.js by holding or executing the status page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - status: this.data.statusIndex === 1 ? 0 : 1 - } - - try { - if (this.data.mode === 'edit') { - await shopApi.updateShop(this.data.shopId, payload) - } else { - await shopApi.createShop(payload) - } - clearDraft(DRAFT_KEY) - markDirty('admin-shops') - markDirty('admin-workbench') - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: this.data.mode === 'edit' ? '店铺已更新' : '店铺已创建', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - navigation.goBack('/pages/shops/index') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '保存失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/shop-form/index.json b/FD-WeChat-Fronted/admin/pages/shop-form/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/shop-form/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/shop-form/index.wxml b/FD-WeChat-Fronted/admin/pages/shop-form/index.wxml deleted file mode 100644 index 4a568352..00000000 --- a/FD-WeChat-Fronted/admin/pages/shop-form/index.wxml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 店铺信息 - - 店铺名称 - - - - 店铺地址 - - - - 营业时间 - - - - 店铺描述 - - - - 状态 - - {{statusOptions[statusIndex]}} - - - - Banner 图 - - 上传 Banner - - - {{form.coverImageFileId}} - - - - 店铺图片 - - 上传图片 - - - - {{item}} - - - - 图片上传中,当前进度 {{uploadProgress}}% - - - - - - diff --git a/FD-WeChat-Fronted/admin/pages/shop-form/index.wxss b/FD-WeChat-Fronted/admin/pages/shop-form/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/shop-form/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/shops/index.js b/FD-WeChat-Fronted/admin/pages/shops/index.js deleted file mode 100644 index 86611894..00000000 --- a/FD-WeChat-Fronted/admin/pages/shops/index.js +++ /dev/null @@ -1,247 +0,0 @@ -/** - * Purpose: shopApi supports index.js by holding or executing the shop api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const shopApi = require('../../api/shop') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -const { setTempRecord, clearTempRecord } = require('../../utils/storage') -const { consumeDirty } = require('../../utils/page-state') - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: '', - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: [], - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false, - /** - * Purpose: canCreate supports index.js by holding or executing the can create page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canCreate: false, - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: false - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入店铺管理')) { - return - } - - const permissionCodes = getApp().globalData.permissionCodes || [] - this.setData({ - /** - * Purpose: canCreate supports index.js by holding or executing the can create page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - canCreate: permissionCodes.includes('shop:create') - }) - - if (!this.data.initialized || consumeDirty('admin-shops')) { - this.loadShops() - } - }, - - /** - * Purpose: handleKeywordInput supports index.js by holding or executing the handle keyword input page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleKeywordInput(event) { - this.setData({ - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: event.detail.value - }) - }, - - /** - * Purpose: handleSearch supports index.js by holding or executing the handle search page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleSearch() { - this.loadShops() - }, - - async loadShops() { - const requestId = (this._loadRequestId || 0) + 1 - this._loadRequestId = requestId - this.setData({ - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: true - }) - - try { - const result = await shopApi.listShops({ - /** - * Purpose: page supports index.js by holding or executing the page page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - page: 1, - /** - * Purpose: size supports index.js by holding or executing the size page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - size: 20, - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: this.data.keyword || undefined - }) - if (requestId !== this._loadRequestId) { - return - } - - this.setData({ - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: (Array.isArray(result && result.list) ? result.list : []).map(item => ({ - ...item, - /** - * Purpose: displayStatusText supports index.js by holding or executing the display status text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayStatusText: Number(item.status) === 0 ? '已停用' : '启用中' - })), - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: true - }) - } catch (error) { - if (requestId !== this._loadRequestId) { - return - } - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '店铺加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } finally { - if (requestId === this._loadRequestId) { - this.setData({ - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false - }) - } - } - }, - - /** - * Purpose: handleCreate supports index.js by holding or executing the handle create page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleCreate() { - clearTempRecord('currentShopRecord') - navigation.navigate('/pages/shop-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create' - }).catch(() => undefined) - }, - - /** - * Purpose: handleEdit supports index.js by holding or executing the handle edit page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleEdit(event) { - const shop = event.currentTarget.dataset.shop - setTempRecord('currentShopRecord', shop) - navigation.navigate('/pages/shop-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'edit', - /** - * Purpose: id supports index.js by holding or executing the id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - id: shop.id - }).catch(() => undefined) - }, - - /** - * Purpose: handleStatus supports index.js by holding or executing the handle status page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleStatus(event) { - const shop = event.currentTarget.dataset.shop - const nextStatus = Number(shop.status) === 0 ? 1 : 0 - shopApi.updateShopStatus(shop.id, nextStatus) - .then(() => { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '店铺状态已更新', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - this.loadShops() - }) - .catch(error => { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '状态更新失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - }) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/shops/index.json b/FD-WeChat-Fronted/admin/pages/shops/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/shops/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/shops/index.wxml b/FD-WeChat-Fronted/admin/pages/shops/index.wxml deleted file mode 100644 index dbf33a36..00000000 --- a/FD-WeChat-Fronted/admin/pages/shops/index.wxml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 店铺列表 - - - - - - - - - - - {{item.shopName}} - {{item.address || '暂无地址'}} - - {{item.displayStatusText}} - - - - 营业时间 - {{item.businessHours || '--'}} - - - 描述 - {{item.description || '暂无描述'}} - - - - 编辑 - {{item.status === 0 ? '启用' : '停用'}} - - - - - - 正在加载店铺列表 - - - - 暂无店铺 - 如果这是首次部署后的无店铺管理员登录,可以直接在这里创建第一家店铺。 - - - + - - diff --git a/FD-WeChat-Fronted/admin/pages/shops/index.wxss b/FD-WeChat-Fronted/admin/pages/shops/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/shops/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/system-messages/index.js b/FD-WeChat-Fronted/admin/pages/system-messages/index.js deleted file mode 100644 index e7fb92b2..00000000 --- a/FD-WeChat-Fronted/admin/pages/system-messages/index.js +++ /dev/null @@ -1,422 +0,0 @@ -/** - * Purpose: messageApi wraps admin system-message endpoints for list, publish, revoke, and target options. - * Usage: call these methods from page event handlers instead of assembling backend URLs in the view layer. - */ -const messageApi = require('../../api/system-message') -/** - * Purpose: navigation handles custom navigation-bar back behavior. - * Usage: call goBack when returning to the management menu. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: permission checks button-level rights for create and revoke actions. - * Usage: pass stored permission codes into hasPermission before rendering or running guarded actions. - */ -const permission = require('../../utils/permission') -/** - * Purpose: auth exposes the current admin permission list stored after login. - * Usage: read user info and permissions when deciding which mobile controls are available. - */ -const auth = require('../../utils/auth') -/** - * Purpose: format converts backend times into mini-program friendly text. - * Usage: call formatDateTime before assigning message rows to data.list. - */ -const format = require('../../utils/format') -/** - * Purpose: actionGuard prevents duplicate publish and revoke submissions from rapid taps. - * Usage: wrap create and revoke requests with actionGuard.run. - */ -const actionGuard = require('../../utils/action-guard') - -/** - * Purpose: TARGET_TYPE_OPTIONS defines publish target scopes supported by the backend contract. - * Usage: render it as chips and submit the selected value as targetType. - */ -const TARGET_TYPE_OPTIONS = [ - { label: '全平台', value: 'PLATFORM_ALL' }, - { label: '指定店铺', value: 'SELECTED_SHOPS' }, - { label: '指定用户', value: 'SELECTED_USERS' } -] - -/** - * Purpose: BUSINESS_TYPE_OPTIONS lists common business navigation types used by order review and artist-change messages. - * Usage: render it as chips and store the selected value in the publish form. - */ -const BUSINESS_TYPE_OPTIONS = [ - { label: '无', value: '' }, - { label: '订单', value: 'ORDER' }, - { label: '评价提醒', value: 'ORDER_ARTIST_REVIEW' }, - { label: '改派申请', value: 'ORDER_ARTIST_CHANGE' } -] - -/** - * Purpose: initialForm returns a clean publish form with popup enabled by default. - * Usage: call it when opening the form and after successful publish. - */ -function initialForm() { - return { - title: '', - content: '', - targetType: 'PLATFORM_ALL', - targetId: '', - popupEnabled: true, - businessType: '', - businessId: '', - actionPath: '' - } -} - -Page({ - /** - * Purpose: data stores system-message list, publish form state, permissions, and picker options. - * Usage: WXML binds these fields and event handlers update them through setData. - */ - data: { - /** - * Purpose: loading shows whether the message list is being refreshed. - * Usage: bind it to page loading lines and refresh controls. - */ - loading: false, - /** - * Purpose: submitting shows whether publish or revoke is currently running. - * Usage: disable action buttons while true. - */ - submitting: false, - /** - * Purpose: list contains formatted system messages visible to the current admin scope. - * Usage: render it in WXML list cards. - */ - list: [], - /** - * Purpose: targetOptions stores backend-provided shops and users for scoped publishing. - * Usage: resolve targetId names and validate selected target choices. - */ - targetOptions: { shops: [], users: [] }, - /** - * Purpose: formVisible controls whether the mobile publish panel is shown. - * Usage: toggle it from header and cancel buttons. - */ - formVisible: false, - /** - * Purpose: form holds publish fields sent to createMessage after validation. - * Usage: update individual properties from inputs and chips. - */ - form: initialForm(), - /** - * Purpose: targetTypeOptions renders publish target scope choices. - * Usage: iterate it in WXML chips. - */ - targetTypeOptions: TARGET_TYPE_OPTIONS, - /** - * Purpose: businessTypeOptions renders common business navigation choices. - * Usage: iterate it in WXML chips. - */ - businessTypeOptions: BUSINESS_TYPE_OPTIONS, - /** - * Purpose: canCreate controls whether the publish action is visible for the current permission set. - * Usage: derive it from message:create permission during onLoad. - */ - canCreate: false, - /** - * Purpose: canRevoke controls whether revoke buttons are visible for the current permission set. - * Usage: derive it from message:delete permission during onLoad. - */ - canRevoke: false - }, - - /** - * Purpose: onLoad initializes permission flags and fetches message list data. - * Usage: mini-program runtime calls it when the operator opens the system-message page. - */ - onLoad() { - const userInfo = auth.getStoredUserInfo() || {} - const codes = userInfo.permissions || [] - this.setData({ - canCreate: permission.hasPermission(codes, 'message:create'), - canRevoke: permission.hasPermission(codes, 'message:delete') - }) - this.loadMessages() - }, - - /** - * Purpose: onPullDownRefresh reloads system messages and target options. - * Usage: mini-program runtime calls it after a manual refresh gesture. - */ - async onPullDownRefresh() { - await this.loadMessages() - wx.stopPullDownRefresh() - }, - - /** - * Purpose: loadMessages refreshes list data and target options for the publish form. - * Usage: call it on page entry, pull refresh, publish success, and revoke success. - */ - async loadMessages() { - this.setData({ loading: true }) - try { - const [messages, targetOptions] = await Promise.all([ - messageApi.listMessages(), - this.data.canCreate ? messageApi.getTargetOptions() : Promise.resolve(this.data.targetOptions) - ]) - this.setData({ - list: (Array.isArray(messages) ? messages : []).map(item => this.formatMessage(item)), - targetOptions: targetOptions || { shops: [], users: [] } - }) - } catch (error) { - wx.showToast({ - title: error.message || '系统消息加载失败', - icon: 'none' - }) - } finally { - this.setData({ loading: false }) - } - }, - - /** - * Purpose: formatMessage normalizes backend message metadata for compact card display. - * Usage: call it on every list item before assigning to data.list. - */ - formatMessage(item) { - return { - ...item, - displayTime: format.formatDateTime(item.publishTime || item.createTime), - statusText: Number(item.status) === 1 ? '已发布' : '已撤回', - popupText: Number(item.popupEnabled) === 1 ? '弹窗' : '不弹窗', - businessText: item.businessType || '无业务跳转', - actionText: item.actionPath || (item.businessId ? `业务 ID:${item.businessId}` : '无') - } - }, - - /** - * Purpose: handleShowForm opens a clean publish panel for authorized operators. - * Usage: bind it to the publish button. - */ - handleShowForm() { - this.setData({ - formVisible: true, - form: initialForm() - }) - }, - - /** - * Purpose: handleHideForm closes the publish panel without submitting. - * Usage: bind it to cancel controls. - */ - handleHideForm() { - this.setData({ formVisible: false }) - }, - - /** - * Purpose: patchForm updates one field in the publish form. - * Usage: call it from input and chip handlers with a partial form object. - */ - patchForm(patch) { - this.setData({ - form: { - ...this.data.form, - ...patch - } - }) - }, - - /** - * Purpose: handleTitleInput stores the publish title input value. - * Usage: bind it to the title input. - */ - handleTitleInput(event) { - this.patchForm({ title: event.detail.value }) - }, - - /** - * Purpose: handleContentInput stores the publish content textarea value. - * Usage: bind it to the content textarea. - */ - handleContentInput(event) { - this.patchForm({ content: event.detail.value }) - }, - - /** - * Purpose: handleTargetIdInput stores selected shop or user id values. - * Usage: bind it to the target id input when targetType is SHOP or USER. - */ - handleTargetIdInput(event) { - this.patchForm({ targetId: event.detail.value }) - }, - - /** - * Purpose: handleBusinessIdInput stores the optional business id used for message navigation. - * Usage: bind it to the business id input. - */ - handleBusinessIdInput(event) { - this.patchForm({ businessId: event.detail.value }) - }, - - /** - * Purpose: handleActionPathInput stores the optional frontend action path used by popup and list taps. - * Usage: bind it to the action path input. - */ - handleActionPathInput(event) { - this.patchForm({ actionPath: event.detail.value }) - }, - - /** - * Purpose: handleTargetTypeChange changes publish target scope and clears stale target ids. - * Usage: bind it to target type chips with data-value. - */ - handleTargetTypeChange(event) { - this.patchForm({ - targetType: event.currentTarget.dataset.value, - targetId: '' - }) - }, - - /** - * Purpose: handleBusinessTypeChange changes the optional business navigation type. - * Usage: bind it to business type chips with data-value. - */ - handleBusinessTypeChange(event) { - this.patchForm({ businessType: event.currentTarget.dataset.value || '' }) - }, - - /** - * Purpose: handlePopupToggle flips whether recipients should see a one-time popup. - * Usage: bind it to the popup switch control. - */ - handlePopupToggle(event) { - this.patchForm({ popupEnabled: Boolean(event.detail.value) }) - }, - - /** - * Purpose: buildPublishPayload validates the form and converts it to backend DTO shape. - * Usage: call it inside handlePublish before createMessage; it returns null after showing validation errors. - */ - buildPublishPayload() { - const form = this.data.form - const title = String(form.title || '').trim() - const content = String(form.content || '').trim() - if (!title || !content) { - wx.showToast({ - title: '请填写标题和内容', - icon: 'none' - }) - return null - } - - const payload = { - title, - content, - targetType: form.targetType, - popupEnabled: form.popupEnabled ? 1 : 0, - businessType: form.businessType || undefined, - businessId: form.businessId ? Number(form.businessId) : undefined, - actionPath: String(form.actionPath || '').trim() || undefined - } - - if (form.targetType === 'SELECTED_SHOPS') { - if (!form.targetId) { - wx.showToast({ title: '请输入店铺 ID', icon: 'none' }) - return null - } - payload.shopIds = [Number(form.targetId)] - } - - if (form.targetType === 'SELECTED_USERS') { - if (!form.targetId) { - wx.showToast({ title: '请输入用户 ID', icon: 'none' }) - return null - } - payload.userIds = [Number(form.targetId)] - } - - return payload - }, - - /** - * Purpose: handlePublish submits the publish form with duplicate-tap protection. - * Usage: bind it to the primary publish button. - */ - async handlePublish() { - const payload = this.buildPublishPayload() - if (!payload) { - return - } - try { - await actionGuard.run(this, 'system-message:publish', async () => { - this.setData({ submitting: true }) - await messageApi.createMessage(payload) - wx.showToast({ - title: '消息已发布', - icon: 'none' - }) - this.setData({ - formVisible: false, - form: initialForm() - }) - await this.loadMessages() - }, { - message: '消息发布中,请勿重复提交' - }) - } catch (error) { - if (actionGuard.isGuardError(error)) { - return - } - wx.showToast({ - title: error.message || '消息发布失败', - icon: 'none' - }) - } finally { - this.setData({ submitting: false }) - } - }, - - /** - * Purpose: handleRevoke revokes one message after operator confirmation. - * Usage: bind it to list-row revoke buttons with data-id. - */ - async handleRevoke(event) { - const id = event.currentTarget.dataset.id - if (!id) { - return - } - const confirmed = await new Promise(resolve => { - wx.showModal({ - title: '撤回消息', - content: '确认撤回这条系统消息吗?', - confirmText: '撤回', - success: res => resolve(Boolean(res.confirm)) - }) - }) - if (!confirmed) { - return - } - try { - await actionGuard.run(this, `system-message:revoke:${id}`, async () => { - await messageApi.revokeMessage(id) - wx.showToast({ - title: '已撤回', - icon: 'none' - }) - await this.loadMessages() - }, { - message: '消息撤回中,请勿重复操作' - }) - } catch (error) { - if (actionGuard.isGuardError(error)) { - return - } - wx.showToast({ - title: error.message || '撤回失败', - icon: 'none' - }) - } - }, - - /** - * Purpose: handleBack returns to the management menu. - * Usage: bind it to the custom navigation bar back event. - */ - handleBack() { - navigation.goBack('/pages/manage/index') - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/system-messages/index.json b/FD-WeChat-Fronted/admin/pages/system-messages/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/system-messages/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/system-messages/index.wxml b/FD-WeChat-Fronted/admin/pages/system-messages/index.wxml deleted file mode 100644 index a6b17a17..00000000 --- a/FD-WeChat-Fronted/admin/pages/system-messages/index.wxml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - Message Center - 消息发布与弹窗配置 - 查看消息列表、弹窗开关、业务跳转和发布状态。 - - - 发布消息 - - - 发布系统消息 - - - - 接收范围 - - - {{item.label}} - - - - 可选店铺:{{targetOptions.shops.length}} 个,输入对应 ID 发布 - 可选用户:{{targetOptions.users.length}} 个,输入对应 ID 发布 - - - 弹窗显示一次 - - - - 业务跳转 - - - {{item.label}} - - - - - - - - - - - - - - - - {{item.title}} - {{item.publisherName || '系统'}} · {{item.displayTime}} - - {{item.popupText}} - - {{item.content}} - - - 状态 - {{item.statusText}} - - - 目标 - {{item.targetTypeName || item.targetType || '--'}} - - - 业务类型 - {{item.businessText}} - - - 跳转 - {{item.actionText}} - - - - 撤回 - - - - - - 暂无系统消息 - 发布后的消息会显示弹窗配置和业务跳转信息。 - - - 加载中... - - diff --git a/FD-WeChat-Fronted/admin/pages/system-messages/index.wxss b/FD-WeChat-Fronted/admin/pages/system-messages/index.wxss deleted file mode 100644 index 8d06965e..00000000 --- a/FD-WeChat-Fronted/admin/pages/system-messages/index.wxss +++ /dev/null @@ -1,66 +0,0 @@ -@import "../../app.wxss"; -.form-card { - display: flex; - flex-direction: column; - gap: 16rpx; -} - -.field-label { - color: #f6efe7; - font-size: 24rpx; - font-weight: 700; -} - -.field-textarea { - width: 100%; - min-height: 180rpx; - box-sizing: border-box; - padding: 18rpx 20rpx; - border-radius: 8rpx; - background: rgba(255, 255, 255, 0.08); - border: 1rpx solid rgba(255, 255, 255, 0.12); - color: #f6efe7; - font-size: 26rpx; - line-height: 1.6; -} - -.switch-row { - display: flex; - align-items: center; - justify-content: space-between; - gap: 20rpx; -} - -.option-hint { - color: #9fb3ad; - font-size: 22rpx; - line-height: 1.5; -} - -.actions-row { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 16rpx; - margin-top: 8rpx; -} - -.message-content { - display: block; - margin-top: 14rpx; - color: #9fb3ad; - font-size: 24rpx; - line-height: 1.6; -} - -.card-actions { - display: flex; - justify-content: flex-end; - margin-top: 18rpx; -} - -.loading-line { - color: #7e8f8c; - font-size: 24rpx; - text-align: center; - padding: 24rpx 0; -} diff --git a/FD-WeChat-Fronted/admin/pages/tag-form/index.js b/FD-WeChat-Fronted/admin/pages/tag-form/index.js deleted file mode 100644 index 2b9eece5..00000000 --- a/FD-WeChat-Fronted/admin/pages/tag-form/index.js +++ /dev/null @@ -1,287 +0,0 @@ -/** - * Purpose: tagApi supports index.js by holding or executing the tag api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const tagApi = require('../../api/tag') -/** - * Purpose: shopApi supports index.js by holding or executing the shop api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const shopApi = require('../../api/shop') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -const { getTempRecord, clearTempRecord } = require('../../utils/storage') - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create', - /** - * Purpose: tagId supports index.js by holding or executing the tag id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tagId: '', - /** - * Purpose: shops supports index.js by holding or executing the shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shops: [], - /** - * Purpose: shopIndex supports index.js by holding or executing the shop index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopIndex: -1, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: '', - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: tagName supports index.js by holding or executing the tag name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tagName: '', - /** - * Purpose: textColor supports index.js by holding or executing the text color page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - textColor: '#2b2b2b', - /** - * Purpose: bgColor supports index.js by holding or executing the bg color page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - bgColor: '#f6e5df', - /** - * Purpose: borderColor supports index.js by holding or executing the border color page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - borderColor: '#ef9a79' - } - }, - - /** - * Purpose: onLoad supports index.js by holding or executing the on load page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onLoad(options) { - const mode = options && options.mode ? options.mode : 'create' - const currentTag = getTempRecord('currentTag', null) - this.setData({ - mode, - /** - * Purpose: tagId supports index.js by holding or executing the tag id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tagId: options && options.id ? options.id : '' - }) - - if (mode === 'edit' && currentTag) { - this.setData({ - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: tagName supports index.js by holding or executing the tag name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - tagName: currentTag.tagName || '', - /** - * Purpose: textColor supports index.js by holding or executing the text color page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - textColor: currentTag.textColor || '#2b2b2b', - /** - * Purpose: bgColor supports index.js by holding or executing the bg color page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - bgColor: currentTag.bgColor || '#f6e5df', - /** - * Purpose: borderColor supports index.js by holding or executing the border color page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - borderColor: currentTag.borderColor || '#ef9a79' - } - }) - this._initialShopId = currentTag.shopId - } - - this.loadShops() - }, - - /** - * Purpose: onUnload supports index.js by holding or executing the on unload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onUnload() { - clearTempRecord('currentTag') - }, - - async loadShops() { - const app = getApp() - const operator = app.globalData.userInfo || {} - const currentShop = app.globalData.currentShop - - try { - const list = await shopApi.listAllShops() - let shops = Array.isArray(list) ? list : [] - - if (Number(operator.type) !== 4 && currentShop) { - shops = shops.filter(item => String(item.id) === String(currentShop.id)) - } - - let shopIndex = 0 - if (this._initialShopId) { - const targetIndex = shops.findIndex(item => String(item.id) === String(this._initialShopId)) - if (targetIndex >= 0) { - shopIndex = targetIndex - } - } - - const selectedShop = shops[shopIndex] - this.setData({ - shops, - shopIndex, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: selectedShop ? selectedShop.shopName : '' - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '初始化标签页面失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleInputChange supports index.js by holding or executing the handle input change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleInputChange(event) { - const field = event.currentTarget.dataset.field - this.setData({ - [`form.${field}`]: event.detail.value - }) - }, - - /** - * Purpose: handleShopChange supports index.js by holding or executing the handle shop change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleShopChange(event) { - const shopIndex = Number(event.detail.value) - const selectedShop = this.data.shops[shopIndex] - this.setData({ - shopIndex, - /** - * Purpose: shopLabel supports index.js by holding or executing the shop label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopLabel: selectedShop ? selectedShop.shopName : '' - }) - }, - - async handleSubmit() { - const selectedShop = this.data.shops[this.data.shopIndex] - if (!this.data.form.tagName) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '请输入标签名称', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - if (!selectedShop) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '请选择所属店铺', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - - const payload = { - ...this.data.form, - /** - * Purpose: shopId supports index.js by holding or executing the shop id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopId: selectedShop.id - } - - try { - if (this.data.mode === 'edit') { - await tagApi.updateTag(this.data.tagId, payload) - } else { - await tagApi.createTag(payload) - } - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: this.data.mode === 'edit' ? '标签已更新' : '标签已创建', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - navigation.goBack('/pages/tags/index') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '保存失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/tag-form/index.json b/FD-WeChat-Fronted/admin/pages/tag-form/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/tag-form/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/tag-form/index.wxml b/FD-WeChat-Fronted/admin/pages/tag-form/index.wxml deleted file mode 100644 index 78c8e223..00000000 --- a/FD-WeChat-Fronted/admin/pages/tag-form/index.wxml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - 标签信息 - - 标签名称 - - - - 所属店铺 - - {{shopLabel || '请选择店铺'}} - - - - 文字颜色 - - - - 背景颜色 - - - - 边框颜色 - - - - - - - - diff --git a/FD-WeChat-Fronted/admin/pages/tag-form/index.wxss b/FD-WeChat-Fronted/admin/pages/tag-form/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/tag-form/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/tags/index.js b/FD-WeChat-Fronted/admin/pages/tags/index.js deleted file mode 100644 index 2ba6b9ee..00000000 --- a/FD-WeChat-Fronted/admin/pages/tags/index.js +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Purpose: tagApi supports index.js by holding or executing the tag api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const tagApi = require('../../api/tag') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -const { setTempRecord, clearTempRecord } = require('../../utils/storage') - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: [] - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入标签管理')) { - return - } - this.loadTags() - }, - - async loadTags() { - try { - const list = await tagApi.listAllTags() - this.setData({ - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: (Array.isArray(list) ? list : []).map(item => ({ - ...item, - /** - * Purpose: displayShopName supports index.js by holding or executing the display shop name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayShopName: item.shopName || '当前店铺' - })) - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '标签加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleCreate supports index.js by holding or executing the handle create page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleCreate() { - clearTempRecord('currentTag') - navigation.navigate('/pages/tag-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create' - }).catch(() => undefined) - }, - - /** - * Purpose: handleEdit supports index.js by holding or executing the handle edit page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleEdit(event) { - const tag = event.currentTarget.dataset.tag - setTempRecord('currentTag', tag) - navigation.navigate('/pages/tag-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'edit', - /** - * Purpose: id supports index.js by holding or executing the id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - id: tag.id - }).catch(() => undefined) - }, - - /** - * Purpose: handleDelete supports index.js by holding or executing the handle delete page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleDelete(event) { - const tag = event.currentTarget.dataset.tag - wx.showModal({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '删除标签', - /** - * Purpose: content supports index.js by holding or executing the content page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - content: `确认删除标签“${tag.tagName}”吗?`, - /** - * Purpose: success supports index.js by holding or executing the success page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - success: async result => { - if (!result.confirm) { - return - } - try { - await tagApi.deleteTag(tag.id) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '标签已删除', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - this.loadTags() - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '标签删除失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } - }) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/tags/index.json b/FD-WeChat-Fronted/admin/pages/tags/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/tags/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/tags/index.wxml b/FD-WeChat-Fronted/admin/pages/tags/index.wxml deleted file mode 100644 index cc4939af..00000000 --- a/FD-WeChat-Fronted/admin/pages/tags/index.wxml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 标签列表 - 标签按店铺绑定,同名标签可以在不同店铺重复存在,适合移动端用卡片方式快速维护。 - - - - - - - {{item.tagName}} - {{item.displayShopName}} - - 颜色标签 - - - {{item.textColor || '#333333'}} - {{item.bgColor || '#f5f5f5'}} - {{item.borderColor || '#dddddd'}} - - - 编辑 - 删除 - - - - - - 还没有标签 - 先创建一组标签,后续作品和优惠券表单就可以直接复用它们。 - - - + - - diff --git a/FD-WeChat-Fronted/admin/pages/tags/index.wxss b/FD-WeChat-Fronted/admin/pages/tags/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/tags/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/user-detail/index.js b/FD-WeChat-Fronted/admin/pages/user-detail/index.js deleted file mode 100644 index 840be0c5..00000000 --- a/FD-WeChat-Fronted/admin/pages/user-detail/index.js +++ /dev/null @@ -1,644 +0,0 @@ -/** - * Purpose: userApi supports index.js by holding or executing the user api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const userApi = require('../../api/user') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: format supports index.js by holding or executing the format page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const format = require('../../utils/format') -const { getTempRecord, clearTempRecord, setTempRecord } = require('../../utils/storage') - -/** - * Purpose: CHANGE_SCENE_OPTIONS supports index.js by holding or executing the change scene options page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const CHANGE_SCENE_OPTIONS = ['MANUAL_RECHARGE', 'MANUAL_INCREASE', 'MANUAL_DEDUCT'] -/** - * Purpose: VIP_LEVEL_OPTIONS supports index.js by holding or executing the vip level options page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const VIP_LEVEL_OPTIONS = ['普通', '青铜', '白银', '黄金'] - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: user supports index.js by holding or executing the user page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - user: null, - /** - * Purpose: asset supports index.js by holding or executing the asset page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - asset: null, - /** - * Purpose: balanceHistory supports index.js by holding or executing the balance history page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - balanceHistory: [], - /** - * Purpose: changeSceneIndex supports index.js by holding or executing the change scene index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - changeSceneIndex: 0, - /** - * Purpose: vipLevelIndex supports index.js by holding or executing the vip level index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - vipLevelIndex: 0, - /** - * Purpose: balanceForm supports index.js by holding or executing the balance form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - balanceForm: { - /** - * Purpose: amount supports index.js by holding or executing the amount page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - amount: '', - /** - * Purpose: externalOrderNo supports index.js by holding or executing the external order no page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - externalOrderNo: '', - /** - * Purpose: remark supports index.js by holding or executing the remark page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - remark: '' - }, - /** - * Purpose: vipRemark supports index.js by holding or executing the vip remark page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - vipRemark: '' - }, - - /** - * Purpose: onLoad supports index.js by holding or executing the on load page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onLoad(options) { - const cached = getTempRecord('currentUser', null) - if (cached && (!options || !options.id || String(cached.id) === String(options.id))) { - this.setUser(cached) - } - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入用户详情')) { - return - } - this.loadAssetData() - }, - - /** - * Purpose: onUnload supports index.js by holding or executing the on unload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onUnload() { - clearTempRecord('currentUser') - }, - - async loadAssetData() { - if (!this.data.user) { - return - } - - try { - const [asset, balanceHistory] = await Promise.all([ - userApi.getUserAsset(this.data.user.id).catch(() => null), - userApi.getUserBalanceHistory(this.data.user.id).catch(() => []) - ]) - - this.setData({ - asset, - /** - * Purpose: balanceHistory supports index.js by holding or executing the balance history page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - balanceHistory: (Array.isArray(balanceHistory) ? balanceHistory : []).map(item => ({ - ...item, - /** - * Purpose: displayChangeTime supports index.js by holding or executing the display change time page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayChangeTime: format.formatDateTime(item.changeTime), - /** - * Purpose: amountBadgeClass supports index.js by holding or executing the amount badge class page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - amountBadgeClass: Number(item.amount) >= 0 ? 'success-badge' : 'danger-badge' - })) - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '用户资产数据加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleEdit supports index.js by holding or executing the handle edit page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleEdit() { - setTempRecord('currentUser', this.data.user) - navigation.navigate('/pages/user-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'edit', - /** - * Purpose: id supports index.js by holding or executing the id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - id: this.data.user.id - }).catch(() => undefined) - }, - - /** - * Purpose: handlePermissionAssign supports index.js by holding or executing the handle permission assign page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handlePermissionAssign() { - setTempRecord('currentUser', this.data.user) - navigation.navigate('/pages/permission-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'assign', - /** - * Purpose: userId supports index.js by holding or executing the user id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userId: this.data.user.id - }).catch(() => undefined) - }, - - /** - * Purpose: handleBalanceInput supports index.js by holding or executing the handle balance input page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleBalanceInput(event) { - const field = event.currentTarget.dataset.field - this.setData({ - [`balanceForm.${field}`]: event.detail.value - }) - }, - - /** - * Purpose: handleVipRemarkInput supports index.js by holding or executing the handle vip remark input page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleVipRemarkInput(event) { - this.setData({ - /** - * Purpose: vipRemark supports index.js by holding or executing the vip remark page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - vipRemark: event.detail.value - }) - }, - - /** - * Purpose: handleSceneChange supports index.js by holding or executing the handle scene change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleSceneChange(event) { - this.setData({ - /** - * Purpose: changeSceneIndex supports index.js by holding or executing the change scene index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - changeSceneIndex: Number(event.detail.value) - }) - }, - - /** - * Purpose: handleVipLevelChange supports index.js by holding or executing the handle vip level change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleVipLevelChange(event) { - this.setData({ - /** - * Purpose: vipLevelIndex supports index.js by holding or executing the vip level index page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - vipLevelIndex: Number(event.detail.value) - }) - }, - - async handleBalanceChange() { - try { - await userApi.changeUserBalance(this.data.user.id, { - /** - * Purpose: amount supports index.js by holding or executing the amount page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - amount: Number(this.data.balanceForm.amount), - /** - * Purpose: changeScene supports index.js by holding or executing the change scene page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - changeScene: CHANGE_SCENE_OPTIONS[this.data.changeSceneIndex], - /** - * Purpose: externalOrderNo supports index.js by holding or executing the external order no page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - externalOrderNo: this.data.balanceForm.externalOrderNo || undefined, - /** - * Purpose: remark supports index.js by holding or executing the remark page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - remark: this.data.balanceForm.remark || undefined - }) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '余额已调整', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - this.setData({ - /** - * Purpose: balanceForm supports index.js by holding or executing the balance form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - balanceForm: { - /** - * Purpose: amount supports index.js by holding or executing the amount page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - amount: '', - /** - * Purpose: externalOrderNo supports index.js by holding or executing the external order no page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - externalOrderNo: '', - /** - * Purpose: remark supports index.js by holding or executing the remark page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - remark: '' - } - }) - this.loadAssetData() - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '余额调整失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - async handleVipOverride() { - try { - await userApi.overrideUserVip(this.data.user.id, { - /** - * Purpose: vipLevel supports index.js by holding or executing the vip level page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - vipLevel: VIP_LEVEL_OPTIONS[this.data.vipLevelIndex], - /** - * Purpose: remark supports index.js by holding or executing the remark page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - remark: this.data.vipRemark || undefined - }) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: 'VIP 等级已更新', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - this.loadAssetData() - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || 'VIP 更新失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - async handleVipRecalculate() { - try { - await userApi.recalculateUserVip(this.data.user.id) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '已恢复自动判级', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - this.loadAssetData() - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || 'VIP 重算失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - async handleResetPassword() { - try { - await userApi.resetPassword(this.data.user.id) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '密码已重置', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '密码重置失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleUserAction supports index.js by holding or executing the handle user action page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleUserAction(event) { - const action = event.currentTarget.dataset.action - if (action === 'disable') { - this.updateUserStatus(this.data.user.status === 0 ? 1 : 0) - return - } - if (action === 'delete') { - this.confirmDelete() - return - } - if (action === 'unbind') { - this.confirmUnbind() - } - }, - - async updateUserStatus(status) { - try { - await userApi.updateUserStatus(this.data.user.id, status) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '用户状态已更新', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - const user = { - ...this.data.user, - status - } - this.setUser(user) - setTempRecord('currentUser', user) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '状态更新失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: confirmDelete supports index.js by holding or executing the confirm delete page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - confirmDelete() { - wx.showModal({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '确认删除', - /** - * Purpose: content supports index.js by holding or executing the content page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - content: '删除后该账号将不再出现在前端可见列表中,确认继续吗?', - /** - * Purpose: success supports index.js by holding or executing the success page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - success: async result => { - if (!result.confirm) { - return - } - try { - await userApi.deleteUser(this.data.user.id) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '用户已删除', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - navigation.goBack('/pages/users/index') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '删除失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } - }) - }, - - /** - * Purpose: confirmUnbind supports index.js by holding or executing the confirm unbind page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - confirmUnbind() { - wx.showModal({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '确认解绑', - /** - * Purpose: content supports index.js by holding or executing the content page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - content: '解绑后,该用户将无法登录当前店铺,确认继续吗?', - /** - * Purpose: success supports index.js by holding or executing the success page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - success: async result => { - if (!result.confirm) { - return - } - try { - await userApi.unbindUser(this.data.user.id) - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: '已解除当前店铺绑定', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '解绑失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - } - }) - }, - - /** - * Purpose: setUser supports index.js by holding or executing the set user page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - setUser(user) { - this.setData({ - /** - * Purpose: user supports index.js by holding or executing the user page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - user: user ? { - ...user, - /** - * Purpose: displayTypeText supports index.js by holding or executing the display type text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayTypeText: format.getUserTypeText(user.type), - /** - * Purpose: displayShopName supports index.js by holding or executing the display shop name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayShopName: format.buildShopName(user), - /** - * Purpose: displayStatusText supports index.js by holding or executing the display status text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayStatusText: format.getUserStatusText(user.status), - /** - * Purpose: displayCreateTime supports index.js by holding or executing the display create time page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayCreateTime: format.formatDateTime(user.createTime) - } : null - }) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/user-detail/index.json b/FD-WeChat-Fronted/admin/pages/user-detail/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/user-detail/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/user-detail/index.wxml b/FD-WeChat-Fronted/admin/pages/user-detail/index.wxml deleted file mode 100644 index 549fa9a4..00000000 --- a/FD-WeChat-Fronted/admin/pages/user-detail/index.wxml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - {{user.nickname || user.account}} - {{user.displayTypeText}} · {{user.displayShopName}} · {{user.displayStatusText}} - - - 账号 - {{user.account}} - - - 手机号 - {{user.phone || '--'}} - - - 签名 - {{user.signature || '暂无签名'}} - - - 创建时间 - {{user.displayCreateTime}} - - - - 编辑资料 - 分配权限 - 重置密码 - - - {{user.status === 0 ? '恢复启用' : '停用账号'}} - 解绑当前店铺 - 删除账号 - - - - - 余额与 VIP - - - 当前余额 - ¥{{asset.balance}} - - - 累计充值 - ¥{{asset.totalRechargeAmount}} - - - VIP 等级 - {{asset.vipLevel || '普通'}} - - - 人工覆盖 - {{asset.manualOverride ? '是' : '否'}} - - - - - - 余额调整 - - 金额(可填负数) - - - - 变动场景 - - {{['MANUAL_RECHARGE','MANUAL_INCREASE','MANUAL_DEDUCT'][changeSceneIndex]}} - - - - 外部单号 - - - - 备注 - - - - - - - - - VIP 管理 - - 手工等级 - - {{['普通','青铜','白银','黄金'][vipLevelIndex]}} - - - - 备注 - - - - - - - - - - 余额流水 - - - - - {{item.changeScene || item.type || '余额变动'}} - {{item.remark || '无备注'}} - - {{item.amount}} - - - - 变动后余额 - {{item.afterBalance || item.currentBalance || '--'}} - - - 变动时间 - {{item.displayChangeTime}} - - - - - - - diff --git a/FD-WeChat-Fronted/admin/pages/user-detail/index.wxss b/FD-WeChat-Fronted/admin/pages/user-detail/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/user-detail/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/user-form/index.js b/FD-WeChat-Fronted/admin/pages/user-form/index.js deleted file mode 100644 index ea1acafc..00000000 --- a/FD-WeChat-Fronted/admin/pages/user-form/index.js +++ /dev/null @@ -1,560 +0,0 @@ -/** - * Purpose: userApi supports index.js by holding or executing the user api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const userApi = require('../../api/user') -/** - * Purpose: shopApi supports index.js by holding or executing the shop api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const shopApi = require('../../api/shop') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: cache supports index.js by holding or executing the cache page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const cache = require('../../utils/cache') -const { getTempRecord, clearTempRecord } = require('../../utils/storage') -const { getDraftValue, clearDraft, scheduleDraftSave, clearDraftTimer } = require('../../utils/form-draft') -const { markDirty } = require('../../utils/page-state') -const { CACHE_TTL } = require('../../utils/config') - -/** - * Purpose: ACCOUNT_REGEX supports index.js by holding or executing the account regex page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const ACCOUNT_REGEX = /[^A-Za-z0-9]/g -/** - * Purpose: PHONE_REGEX supports index.js by holding or executing the phone regex page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const PHONE_REGEX = /[^\d]/g -/** - * Purpose: DRAFT_KEY supports index.js by holding or executing the draft key page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const DRAFT_KEY = 'admin-user-form' -/** - * Purpose: TYPE_OPTIONS supports index.js by holding or executing the type options page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const TYPE_OPTIONS = [ - { label: '普通用户', value: 0 }, - { label: '店长', value: 2 }, - { label: '美甲师', value: 3 }, - { label: '平台管理员', value: 4 } -] - -/** - * Purpose: normalizeId supports index.js by holding or executing the normalize id page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function normalizeId(value) { - return value === undefined || value === null ? '' : String(value) -} - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create', - /** - * Purpose: userId supports index.js by holding or executing the user id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userId: '', - /** - * Purpose: typeOptions supports index.js by holding or executing the type options page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - typeOptions: TYPE_OPTIONS, - /** - * Purpose: currentTypeLabel supports index.js by holding or executing the current type label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - currentTypeLabel: TYPE_OPTIONS[0].label, - /** - * Purpose: shops supports index.js by holding or executing the shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shops: [], - /** - * Purpose: selectedShopIds supports index.js by holding or executing the selected shop ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - selectedShopIds: [], - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: nickname supports index.js by holding or executing the nickname page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - nickname: '', - /** - * Purpose: account supports index.js by holding or executing the account page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - account: '', - /** - * Purpose: phone supports index.js by holding or executing the phone page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - phone: '', - /** - * Purpose: password supports index.js by holding or executing the password page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - password: '', - /** - * Purpose: signature supports index.js by holding or executing the signature page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - signature: '', - /** - * Purpose: type supports index.js by holding or executing the type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - type: 0 - } - }, - - /** - * Purpose: onLoad supports index.js by holding or executing the on load page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onLoad(options) { - const mode = options && options.mode ? options.mode : 'create' - const currentUser = getTempRecord('currentUser', null) - const draft = getDraftValue(DRAFT_KEY, null) - const app = getApp() - const operator = app.globalData.userInfo || {} - - let availableTypes = TYPE_OPTIONS - if (Number(operator.type) === 2) { - availableTypes = TYPE_OPTIONS.filter(item => item.value === 0 || item.value === 3) - } - - const baseState = { - mode, - /** - * Purpose: userId supports index.js by holding or executing the user id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userId: options && options.id ? options.id : '', - /** - * Purpose: typeOptions supports index.js by holding or executing the type options page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - typeOptions: availableTypes, - /** - * Purpose: currentTypeLabel supports index.js by holding or executing the current type label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - currentTypeLabel: availableTypes[0] ? availableTypes[0].label : '' - } - - if (mode === 'edit' && currentUser) { - baseState.form = { - /** - * Purpose: nickname supports index.js by holding or executing the nickname page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - nickname: currentUser.nickname || '', - /** - * Purpose: account supports index.js by holding or executing the account page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - account: currentUser.account || '', - /** - * Purpose: phone supports index.js by holding or executing the phone page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - phone: currentUser.phone || '', - /** - * Purpose: password supports index.js by holding or executing the password page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - password: '', - /** - * Purpose: signature supports index.js by holding or executing the signature page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - signature: currentUser.signature || '', - /** - * Purpose: type supports index.js by holding or executing the type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - type: Number(currentUser.type || 0) - } - baseState.selectedShopIds = Array.isArray(currentUser.shopIds) ? currentUser.shopIds.map(item => String(item)) : [] - } - - this.setData(baseState) - - if (draft && draft.mode === mode) { - this.setData({ - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - ...this.data.form, - ...draft.form, - /** - * Purpose: password supports index.js by holding or executing the password page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - password: '' - }, - /** - * Purpose: selectedShopIds supports index.js by holding or executing the selected shop ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - selectedShopIds: Array.isArray(draft.selectedShopIds) ? draft.selectedShopIds : this.data.selectedShopIds - }) - } - - this.syncTypeLabel(Number(this.data.form.type || 0)) - this.loadShops() - }, - - /** - * Purpose: onUnload supports index.js by holding or executing the on unload page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onUnload() { - clearTempRecord('currentUser') - clearDraftTimer(this) - }, - - /** - * Purpose: scheduleUserDraft supports index.js by holding or executing the schedule user draft page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - scheduleUserDraft() { - scheduleDraftSave(this, DRAFT_KEY, () => ({ - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: this.data.mode, - /** - * Purpose: form supports index.js by holding or executing the form page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - form: { - /** - * Purpose: nickname supports index.js by holding or executing the nickname page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - nickname: this.data.form.nickname, - /** - * Purpose: account supports index.js by holding or executing the account page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - account: this.data.form.account, - /** - * Purpose: phone supports index.js by holding or executing the phone page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - phone: this.data.form.phone, - /** - * Purpose: signature supports index.js by holding or executing the signature page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - signature: this.data.form.signature, - /** - * Purpose: type supports index.js by holding or executing the type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - type: Number(this.data.form.type) - }, - /** - * Purpose: selectedShopIds supports index.js by holding or executing the selected shop ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - selectedShopIds: this.data.selectedShopIds.slice() - })) - }, - - async loadShops() { - try { - const shops = await cache.remember('admin:shops:all', CACHE_TTL.dict, () => shopApi.listAllShops()) - const app = getApp() - const operator = app.globalData.userInfo || {} - const currentShop = app.globalData.currentShop - - if (Number(operator.type) !== 4 && currentShop) { - this.setData({ - /** - * Purpose: shops supports index.js by holding or executing the shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shops: (Array.isArray(shops) ? shops : []).filter(item => normalizeId(item.id) === normalizeId(currentShop.id)).map(item => ({ - ...item, - /** - * Purpose: valueId supports index.js by holding or executing the value id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - valueId: normalizeId(item.id), - /** - * Purpose: checked supports index.js by holding or executing the checked page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - checked: true - })), - /** - * Purpose: selectedShopIds supports index.js by holding or executing the selected shop ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - selectedShopIds: [normalizeId(currentShop.id)] - }) - this.scheduleUserDraft() - return - } - - this.setData({ - /** - * Purpose: shops supports index.js by holding or executing the shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shops: (Array.isArray(shops) ? shops : []).map(item => ({ - ...item, - /** - * Purpose: valueId supports index.js by holding or executing the value id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - valueId: normalizeId(item.id), - /** - * Purpose: checked supports index.js by holding or executing the checked page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - checked: this.data.selectedShopIds.includes(normalizeId(item.id)) - })) - }) - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '店铺列表加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: handleInputChange supports index.js by holding or executing the handle input change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleInputChange(event) { - const field = event.currentTarget.dataset.field - let value = event.detail.value - - if (field === 'account') { - value = String(value || '').replace(ACCOUNT_REGEX, '') - } - - if (field === 'phone') { - value = String(value || '').replace(PHONE_REGEX, '').slice(0, 11) - } - - this.setData({ - [`form.${field}`]: value - }) - if (field !== 'password') { - this.scheduleUserDraft() - } - }, - - /** - * Purpose: handleTypeChange supports index.js by holding or executing the handle type change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleTypeChange(event) { - const index = Number(event.detail.value) - const item = this.data.typeOptions[index] - this.setData({ - 'form.type': item ? item.value : 0, - /** - * Purpose: currentTypeLabel supports index.js by holding or executing the current type label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - currentTypeLabel: item ? item.label : '' - }) - this.scheduleUserDraft() - }, - - /** - * Purpose: handleShopCheck supports index.js by holding or executing the handle shop check page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleShopCheck(event) { - const selectedShopIds = event.detail.value || [] - this.setData({ - selectedShopIds, - /** - * Purpose: shops supports index.js by holding or executing the shops page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shops: this.data.shops.map(item => ({ - ...item, - /** - * Purpose: checked supports index.js by holding or executing the checked page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - checked: selectedShopIds.includes(String(item.id)) - })) - }) - this.scheduleUserDraft() - }, - - /** - * Purpose: validateForm supports index.js by holding or executing the validate form page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - validateForm() { - const form = this.data.form - if (!form.nickname) { - return '请输入用户昵称' - } - if (!form.account) { - return '请输入账号' - } - if (!form.phone || form.phone.length !== 11) { - return '请输入 11 位手机号' - } - if (this.data.mode === 'create' && !form.password) { - return '新增用户时必须设置密码' - } - if (!this.data.selectedShopIds.length) { - return '请至少绑定一个店铺' - } - return '' - }, - - async handleSubmit() { - const errorMessage = this.validateForm() - if (errorMessage) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: errorMessage, - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - return - } - - const payload = { - /** - * Purpose: nickname supports index.js by holding or executing the nickname page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - nickname: this.data.form.nickname, - /** - * Purpose: account supports index.js by holding or executing the account page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - account: this.data.form.account, - /** - * Purpose: phone supports index.js by holding or executing the phone page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - phone: this.data.form.phone, - /** - * Purpose: signature supports index.js by holding or executing the signature page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - signature: this.data.form.signature || undefined, - /** - * Purpose: type supports index.js by holding or executing the type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - type: Number(this.data.form.type), - /** - * Purpose: shopIds supports index.js by holding or executing the shop ids page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shopIds: this.data.selectedShopIds.map(item => Number(item)) - } - - if (this.data.form.password) { - payload.password = this.data.form.password - } - - try { - if (this.data.mode === 'edit') { - await userApi.updateUser(this.data.userId, payload) - } else { - await userApi.createUser(payload) - } - clearDraft(DRAFT_KEY) - markDirty('admin-users') - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: this.data.mode === 'edit' ? '用户已更新' : '用户已创建', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - navigation.goBack('/pages/users/index') - } catch (error) { - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '保存失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } - }, - - /** - * Purpose: syncTypeLabel supports index.js by holding or executing the sync type label page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - syncTypeLabel(type) { - const target = this.data.typeOptions.find(item => Number(item.value) === Number(type)) - this.setData({ - /** - * Purpose: currentTypeLabel supports index.js by holding or executing the current type label page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - currentTypeLabel: target ? target.label : '' - }) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/user-form/index.json b/FD-WeChat-Fronted/admin/pages/user-form/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/user-form/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/user-form/index.wxml b/FD-WeChat-Fronted/admin/pages/user-form/index.wxml deleted file mode 100644 index 2dc10b8b..00000000 --- a/FD-WeChat-Fronted/admin/pages/user-form/index.wxml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - {{mode === 'edit' ? '更新用户资料' : '创建后台账号'}} - 账号仅允许字母和数字,手机号保持全局唯一。店长创建美甲师时,这里会直接绑定当前店铺。 - - - 昵称 - - - - 账号 - - - - 手机号 - - - - {{mode === 'edit' ? '密码(留空则不修改)' : '登录密码'}} - - - - 签名 - - - - 角色 - - {{currentTypeLabel || '请选择角色'}} - - - - 绑定店铺 - - - - - - - - - - - - diff --git a/FD-WeChat-Fronted/admin/pages/user-form/index.wxss b/FD-WeChat-Fronted/admin/pages/user-form/index.wxss deleted file mode 100644 index c7f2860b..00000000 --- a/FD-WeChat-Fronted/admin/pages/user-form/index.wxss +++ /dev/null @@ -1,5 +0,0 @@ -@import "../../app.wxss"; -checkbox { - transform: scale(0.75); - margin-right: 8rpx; -} diff --git a/FD-WeChat-Fronted/admin/pages/users/index.js b/FD-WeChat-Fronted/admin/pages/users/index.js deleted file mode 100644 index 5539b818..00000000 --- a/FD-WeChat-Fronted/admin/pages/users/index.js +++ /dev/null @@ -1,267 +0,0 @@ -/** - * Purpose: userApi supports index.js by holding or executing the user api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const userApi = require('../../api/user') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: format supports index.js by holding or executing the format page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const format = require('../../utils/format') -const { setTempRecord, clearTempRecord } = require('../../utils/storage') -const { consumeDirty } = require('../../utils/page-state') - -/** - * Purpose: TYPE_OPTIONS supports index.js by holding or executing the type options page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const TYPE_OPTIONS = [ - { label: '全部角色', value: '' }, - { label: '普通用户', value: 0 }, - { label: '店长', value: 2 }, - { label: '美甲师', value: 3 }, - { label: '管理员', value: 4 } -] - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: '', - /** - * Purpose: type supports index.js by holding or executing the type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - type: '', - /** - * Purpose: typeOptions supports index.js by holding or executing the type options page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - typeOptions: TYPE_OPTIONS, - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: [], - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false, - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: false - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入用户管理')) { - return - } - if (!this.data.initialized || consumeDirty('admin-users')) { - this.loadUsers() - } - }, - - /** - * Purpose: handleKeywordInput supports index.js by holding or executing the handle keyword input page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleKeywordInput(event) { - this.setData({ - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: event.detail.value - }) - }, - - /** - * Purpose: handleSearch supports index.js by holding or executing the handle search page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleSearch() { - this.loadUsers() - }, - - /** - * Purpose: handleTypeChange supports index.js by holding or executing the handle type change page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleTypeChange(event) { - this.setData({ - /** - * Purpose: type supports index.js by holding or executing the type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - type: event.currentTarget.dataset.type - }) - this.loadUsers() - }, - - async loadUsers() { - const requestId = (this._loadRequestId || 0) + 1 - this._loadRequestId = requestId - this.setData({ - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: true - }) - - try { - const result = await userApi.listUsers({ - /** - * Purpose: page supports index.js by holding or executing the page page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - page: 1, - /** - * Purpose: size supports index.js by holding or executing the size page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - size: 20, - /** - * Purpose: keyword supports index.js by holding or executing the keyword page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - keyword: this.data.keyword || undefined, - /** - * Purpose: type supports index.js by holding or executing the type page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - type: this.data.type === '' ? undefined : this.data.type - }) - - if (requestId !== this._loadRequestId) { - return - } - - this.setData({ - /** - * Purpose: list supports index.js by holding or executing the list page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - list: (Array.isArray(result && result.list) ? result.list : []).map(item => ({ - ...item, - /** - * Purpose: displayShopName supports index.js by holding or executing the display shop name page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayShopName: format.buildShopName(item), - /** - * Purpose: displayTypeText supports index.js by holding or executing the display type text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayTypeText: format.getUserTypeText(item.type), - /** - * Purpose: displayStatusText supports index.js by holding or executing the display status text page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - displayStatusText: format.getUserStatusText(item.status) - })), - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: true - }) - } catch (error) { - if (requestId !== this._loadRequestId) { - return - } - wx.showToast({ - /** - * Purpose: title supports index.js by holding or executing the title page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - title: error.message || '用户列表加载失败', - /** - * Purpose: icon supports index.js by holding or executing the icon page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - icon: 'none' - }) - } finally { - if (requestId === this._loadRequestId) { - this.setData({ - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false - }) - } - } - }, - - /** - * Purpose: handleOpenDetail supports index.js by holding or executing the handle open detail page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleOpenDetail(event) { - const user = event.currentTarget.dataset.user - setTempRecord('currentUser', user) - navigation.navigate('/pages/user-detail/index', { - /** - * Purpose: id supports index.js by holding or executing the id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - id: user.id - }).catch(() => undefined) - }, - - /** - * Purpose: handleEdit supports index.js by holding or executing the handle edit page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleEdit(event) { - const user = event.currentTarget.dataset.user - setTempRecord('currentUser', user) - navigation.navigate('/pages/user-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'edit', - /** - * Purpose: id supports index.js by holding or executing the id page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - id: user.id - }).catch(() => undefined) - }, - - /** - * Purpose: handleCreate supports index.js by holding or executing the handle create page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleCreate() { - clearTempRecord('currentUser') - navigation.navigate('/pages/user-form/index', { - /** - * Purpose: mode supports index.js by holding or executing the mode page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - mode: 'create' - }).catch(() => undefined) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/users/index.json b/FD-WeChat-Fronted/admin/pages/users/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/users/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/users/index.wxml b/FD-WeChat-Fronted/admin/pages/users/index.wxml deleted file mode 100644 index 1fc6a285..00000000 --- a/FD-WeChat-Fronted/admin/pages/users/index.wxml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 筛选用户 - - - - - - - {{item.label}} - - - - - - - - - {{item.nickname || '未命名用户'}} · {{item.account}} - {{item.displayShopName}} - - {{item.displayStatusText}} - - - - 角色 - {{item.displayTypeText}} - - - 手机号 - {{item.phone || '--'}} - - - VIP - {{item.vipLevel || item.level || '普通'}} - - - 创建时间 - {{item.createTime}} - - - - 详情 - 编辑 - - - - - - 正在加载用户列表 - - - - 暂无匹配用户 - 可以先清空筛选条件,或者直接新增一个新用户。 - - - + - - diff --git a/FD-WeChat-Fronted/admin/pages/users/index.wxss b/FD-WeChat-Fronted/admin/pages/users/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/users/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/pages/workbench/index.js b/FD-WeChat-Fronted/admin/pages/workbench/index.js deleted file mode 100644 index ab39b10c..00000000 --- a/FD-WeChat-Fronted/admin/pages/workbench/index.js +++ /dev/null @@ -1,508 +0,0 @@ -/** - * Purpose: dashboardApi supports index.js by holding or executing the dashboard api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const dashboardApi = require('../../api/dashboard') -/** - * Purpose: orderApi supports index.js by holding or executing the order api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const orderApi = require('../../api/order') -/** - * Purpose: navigation supports index.js by holding or executing the navigation page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const navigation = require('../../utils/navigation') -/** - * Purpose: permission supports index.js by holding or executing the permission page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const permission = require('../../utils/permission') -/** - * Purpose: cache supports index.js by holding or executing the cache page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const cache = require('../../utils/cache') -const { CACHE_TTL } = require('../../utils/config') -const { consumeDirty } = require('../../utils/page-state') - -function formatMoney(value) { - return Number(value || 0).toFixed(2) -} - -Page({ - /** - * Purpose: data supports index.js by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { - /** - * Purpose: userInfo supports index.js by holding or executing the user info page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - userInfo: null, - /** - * Purpose: currentShop supports index.js by holding or executing the current shop page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - currentShop: null, - /** - * Purpose: permissionCount supports index.js by holding or executing the permission count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionCount: 0, - /** - * Purpose: shortcutModules supports index.js by holding or executing the shortcut modules page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shortcutModules: [], - /** - * Purpose: stats supports index.js by holding or executing the stats page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - stats: null, - /** - * Purpose: pendingOrders supports index.js by holding or executing the pending orders page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - pendingOrders: 0, - /** - * Purpose: analytics stores vNext operations analytics for the mobile workbench summary. - * Usage: set from dashboard analytics when the current user has analytics:view. - */ - analytics: null, - /** - * Purpose: todoStats stores lightweight operations todo counters for the workbench. - * Usage: show pending order and vNext operations counts without blocking the base dashboard. - */ - todoStats: [], - /** - * Purpose: shoplessAdmin supports index.js by holding or executing the shopless admin page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shoplessAdmin: false, - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false, - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: false - }, - - /** - * Purpose: onShow supports index.js by holding or executing the on show page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - onShow() { - if (!navigation.ensureLogin('进入工作台')) { - return - } - - this.syncGlobalState() - const dirty = consumeDirty('admin-workbench') - if (!this.data.initialized || dirty) { - this.loadDashboard({ - /** - * Purpose: force supports index.js by holding or executing the force page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - force: dirty - }) - } - }, - - /** - * Purpose: syncGlobalState supports index.js by holding or executing the sync global state page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - syncGlobalState() { - const app = getApp() - const userInfo = app.globalData.userInfo - const currentShop = app.globalData.currentShop - const permissionCodes = app.globalData.permissionCodes || [] - const modules = permission.getManageModules(userInfo, permissionCodes, currentShop) - - this.setData({ - userInfo, - currentShop, - /** - * Purpose: permissionCount supports index.js by holding or executing the permission count page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - permissionCount: permissionCodes.length, - /** - * Purpose: shortcutModules supports index.js by holding or executing the shortcut modules page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shortcutModules: modules.filter(item => item.allowed).slice(0, 4), - /** - * Purpose: shoplessAdmin supports index.js by holding or executing the shopless admin page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - shoplessAdmin: permission.isPlatformAdmin(userInfo) && !currentShop - }) - }, - - async loadDashboard(options) { - const requestId = (this._loadRequestId || 0) + 1 - this._loadRequestId = requestId - const force = Boolean(options && options.force) - const app = getApp() - const permissionCodes = app.globalData.permissionCodes || [] - const currentShopId = this.data.currentShop && this.data.currentShop.id ? String(this.data.currentShop.id) : 'none' - const statsCacheKey = `workbench:stats:${currentShopId}` - const pendingCacheKey = `workbench:pending:${currentShopId}` - const analyticsCacheKey = `workbench:analytics:${currentShopId}` - - this.setData({ - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: true - }) - - if (this.data.shoplessAdmin) { - if (requestId === this._loadRequestId) { - this.setData({ - /** - * Purpose: stats supports index.js by holding or executing the stats page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - stats: null, - analytics: null, - todoStats: [], - /** - * Purpose: pendingOrders supports index.js by holding or executing the pending orders page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - pendingOrders: 0, - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false, - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: true - }) - } - return - } - - if (permission.hasPermission(permissionCodes, 'dashboard:view')) { - try { - if (force) { - cache.removeCache(statsCacheKey) - } - const stats = force - ? await dashboardApi.getStats() - : await cache.remember(statsCacheKey, CACHE_TTL.workbench, () => dashboardApi.getStats()) - if (requestId !== this._loadRequestId) { - return - } - this.setData({ - stats, - /** - * Purpose: pendingOrders supports index.js by holding or executing the pending orders page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - pendingOrders: Number(stats && stats.todayOrders) || 0, - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false, - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: true - }) - } catch (error) {} - } - - await this.loadOperationsSummary({ - requestId, - force, - permissionCodes, - analyticsCacheKey, - pendingCacheKey - }) - if (requestId !== this._loadRequestId) { - return - } - if (this.data.initialized) { - return - } - - if (this.data.analytics || this.data.todoStats.length) { - this.setData({ - loading: false, - initialized: true - }) - return - } - - if (permission.hasPermission(permissionCodes, 'order:view')) { - try { - if (force) { - cache.removeCache(pendingCacheKey) - } - const result = force - ? await orderApi.listOrders({ - /** - * Purpose: page supports index.js by holding or executing the page page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - page: 1, - /** - * Purpose: size supports index.js by holding or executing the size page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - size: 20, - /** - * Purpose: status supports index.js by holding or executing the status page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - status: 1 - }) - : await cache.remember(pendingCacheKey, CACHE_TTL.workbench, () => orderApi.listOrders({ - /** - * Purpose: page supports index.js by holding or executing the page page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - page: 1, - /** - * Purpose: size supports index.js by holding or executing the size page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - size: 20, - /** - * Purpose: status supports index.js by holding or executing the status page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - status: 1 - })) - if (requestId !== this._loadRequestId) { - return - } - this.setData({ - /** - * Purpose: stats supports index.js by holding or executing the stats page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - stats: null, - /** - * Purpose: pendingOrders supports index.js by holding or executing the pending orders page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - pendingOrders: Number(result && result.total) || 0, - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false, - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: true - }) - } catch (error) { - if (requestId === this._loadRequestId) { - this.setData({ - /** - * Purpose: stats supports index.js by holding or executing the stats page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - stats: null, - /** - * Purpose: pendingOrders supports index.js by holding or executing the pending orders page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - pendingOrders: 0, - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false, - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: true - }) - } - } - return - } - - if (requestId === this._loadRequestId) { - this.setData({ - /** - * Purpose: stats supports index.js by holding or executing the stats page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - stats: null, - /** - * Purpose: pendingOrders supports index.js by holding or executing the pending orders page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - pendingOrders: 0, - /** - * Purpose: loading supports index.js by holding or executing the loading page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - loading: false, - /** - * Purpose: initialized supports index.js by holding or executing the initialized page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - initialized: true - }) - } - }, - - async loadOperationsSummary(options) { - const requestId = options.requestId - const force = options.force - const permissionCodes = options.permissionCodes || [] - const analyticsCacheKey = options.analyticsCacheKey - const pendingCacheKey = options.pendingCacheKey - const tasks = [] - - if (permission.hasPermission(permissionCodes, 'analytics:view')) { - if (force) { - cache.removeCache(analyticsCacheKey) - } - tasks.push(cache.remember(analyticsCacheKey, CACHE_TTL.workbench, () => dashboardApi.getAnalytics()) - .then(analytics => ({ key: 'analytics', value: analytics })) - .catch(() => ({ key: 'analytics', value: null }))) - } - - if (permission.hasPermission(permissionCodes, 'order:view')) { - if (force) { - cache.removeCache(pendingCacheKey) - } - tasks.push(cache.remember(pendingCacheKey, CACHE_TTL.workbench, () => orderApi.listOrders({ - page: 1, - size: 1, - status: 1 - })).then(result => ({ - key: 'pendingOrders', - value: Number(result && result.total) || 0 - })).catch(() => ({ - key: 'pendingOrders', - value: 0 - }))) - } - - if (!tasks.length) { - return - } - - const results = await Promise.all(tasks) - if (requestId !== this._loadRequestId) { - return - } - const nextData = {} - results.forEach(item => { - nextData[item.key] = item.value - }) - const analytics = Object.prototype.hasOwnProperty.call(nextData, 'analytics') ? nextData.analytics : this.data.analytics - const pendingOrders = Object.prototype.hasOwnProperty.call(nextData, 'pendingOrders') ? nextData.pendingOrders : this.data.pendingOrders - nextData.todoStats = this.buildTodoStats(analytics, pendingOrders, permissionCodes) - nextData.analytics = analytics - nextData.pendingOrders = pendingOrders - this.setData(nextData) - }, - - buildTodoStats(analytics, pendingOrders, permissionCodes) { - const todos = [] - if (permission.hasPermission(permissionCodes, 'order:view')) { - todos.push({ - key: 'orders', - label: '待服务订单', - value: pendingOrders || 0, - note: '来自订单待服务状态', - path: '/pages/orders/index' - }) - } - if (permission.hasPermission(permissionCodes, 'after_sale:view')) { - todos.push({ - key: 'afterSales', - label: '售后待处理', - value: '--', - note: '进入售后处理查看明细', - path: '/pages/after-sales/index' - }) - } - if (permission.hasPermission(permissionCodes, 'inventory:view')) { - todos.push({ - key: 'inventory', - label: '库存预警', - value: '--', - note: '进入库存管理查看低库存', - path: '/pages/inventory/index' - }) - } - if (analytics) { - todos.push({ - key: 'paid', - label: '已支付订单', - value: Number(analytics.paidOrderCount) || 0, - note: `GMV ¥${formatMoney(analytics.totalAmount)}` - }) - } - return todos.slice(0, 4) - }, - - /** - * Purpose: handleOpenModule supports index.js by holding or executing the handle open module page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleOpenModule(event) { - const path = event.currentTarget.dataset.path - if (!path) { - return - } - - if (path === '/pages/orders/index') { - navigation.switchTab(path) - return - } - - navigation.navigate(path).catch(() => undefined) - }, - - /** - * Purpose: handleOpenShops supports index.js by holding or executing the handle open shops page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleOpenShops() { - navigation.navigate('/pages/shops/index').catch(() => undefined) - }, - - /** - * Purpose: handleOpenOrders supports index.js by holding or executing the handle open orders page or API role. - * Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow. - */ - handleOpenOrders() { - navigation.switchTab('/pages/orders/index').catch(() => undefined) - }, - - handleOpenManage() { - navigation.switchTab('/pages/manage/index').catch(() => undefined) - }, - - handleOpenProfile() { - navigation.switchTab('/pages/profile/index').catch(() => undefined) - } -}) diff --git a/FD-WeChat-Fronted/admin/pages/workbench/index.json b/FD-WeChat-Fronted/admin/pages/workbench/index.json deleted file mode 100644 index 5833c0ef..00000000 --- a/FD-WeChat-Fronted/admin/pages/workbench/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "usingComponents": { - "navigation-bar": "/admin/components/navigation-bar/navigation-bar" - } -} diff --git a/FD-WeChat-Fronted/admin/pages/workbench/index.wxml b/FD-WeChat-Fronted/admin/pages/workbench/index.wxml deleted file mode 100644 index 9bedfa41..00000000 --- a/FD-WeChat-Fronted/admin/pages/workbench/index.wxml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - {{userInfo.nickname || userInfo.account || '后台账号'}} - {{currentShop ? currentShop.shopName : '平台总览模式'}} - 当前身份:{{userInfo ? userInfo.type === 4 ? '平台管理员' : userInfo.type === 2 ? '店长' : '美甲师' : '--'}}。已同步 {{permissionCount}} 项后台权限。 - - {{currentShop ? '当前店铺已锁定' : '平台总览'}} - {{shoplessAdmin ? '店铺业务仅查看' : '移动端工作流已就绪'}} - - - - - 平台总览模式 - 当前管理员不绑定具体店铺,可查看全局数据和店铺业务列表;涉及新增、编辑、删除、发放等操作会被服务端拦截。 - - - - - - - 今日概览 - 把高频动作和最关键的经营数字集中到一屏,方便在手机上快速判断接下来该处理什么。 - - - 待处理订单 - {{pendingOrders}} - 优先处理预约确认与履约 - - - 当前权限 - {{permissionCount}} - 前端仅做显隐,服务端仍会兜底校验 - - - 经营订单 - {{analytics.orderCount || 0}} - 支付 {{analytics.paidOrderCount || 0}} · 完成 {{analytics.completedOrderCount || 0}} - - - 收藏/加购 - {{analytics.favoriteCount || 0}}/{{analytics.cartCount || 0}} - 浏览 {{analytics.viewCount || 0}} · 评价 {{analytics.reviewCount || 0}} - - - 用户总量 - {{stats.totalUsers || 0}} - 按当前角色与店铺范围计算 - - - 作品总量 - {{stats.totalProducts || 0}} - 支持后续直接跳去作品管理 - - - - - - - - - 待办与运营 - 同步 vNext 运营能力的轻量摘要,点有入口的待办可直接进入处理页。 - - - - {{item.label}} - {{item.value}} - {{item.note}} - - - - - - - 快捷入口 - 只展示当前账号真实可进入的模块,避免手机端一屏堆太多无权限入口。 - - - - - {{item.title}} - {{item.description}} - - 进入 - - - - - 暂无可用快捷入口 - 当前账号没有可直接打开的后台模块,请先检查权限或切换店铺。 - - - - 工作台 - 订单 - 经营 - 我的 - - - diff --git a/FD-WeChat-Fronted/admin/pages/workbench/index.wxss b/FD-WeChat-Fronted/admin/pages/workbench/index.wxss deleted file mode 100644 index 8593327f..00000000 --- a/FD-WeChat-Fronted/admin/pages/workbench/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../../app.wxss"; -.page-shell { - background: transparent; -} diff --git a/FD-WeChat-Fronted/admin/utils/auth.js b/FD-WeChat-Fronted/admin/utils/auth.js deleted file mode 100644 index 8f86cd68..00000000 --- a/FD-WeChat-Fronted/admin/utils/auth.js +++ /dev/null @@ -1,147 +0,0 @@ -const { STORAGE_KEYS, getStorage, removeStorage, setStorage } = require('./storage') - -/** - * Purpose: getAccessToken supports auth.js by holding or executing the get access token page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getAccessToken() { - return getStorage(STORAGE_KEYS.ACCESS_TOKEN, '') -} - -/** - * Purpose: getRefreshToken supports auth.js by holding or executing the get refresh token page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getRefreshToken() { - return getStorage(STORAGE_KEYS.REFRESH_TOKEN, '') -} - -/** - * Purpose: getStoredUserInfo supports auth.js by holding or executing the get stored user info page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getStoredUserInfo() { - return getStorage(STORAGE_KEYS.USER_INFO, null) -} - -/** - * Purpose: getStoredPermissions supports auth.js by holding or executing the get stored permissions page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getStoredPermissions() { - return getStorage(STORAGE_KEYS.PERMISSIONS, []) -} - -/** - * Purpose: getCurrentShop supports auth.js by holding or executing the get current shop page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getCurrentShop() { - return getStorage(STORAGE_KEYS.CURRENT_SHOP, null) -} - -/** - * Purpose: isLoggedIn supports auth.js by holding or executing the is logged in page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function isLoggedIn() { - return Boolean(getAccessToken()) -} - -/** - * Purpose: setSession supports auth.js by holding or executing the set session page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function setSession(payload) { - if (!payload || !payload.accessToken || !payload.refreshToken) { - return - } - - setStorage(STORAGE_KEYS.ACCESS_TOKEN, payload.accessToken) - setStorage(STORAGE_KEYS.REFRESH_TOKEN, payload.refreshToken) - - if (payload.userInfo) { - setStorage(STORAGE_KEYS.USER_INFO, payload.userInfo) - - if (payload.userInfo.shopId) { - setCurrentShop({ - id: payload.userInfo.shopId, - shopName: payload.userInfo.shopName || '' - }) - } else { - removeStorage(STORAGE_KEYS.CURRENT_SHOP) - } - } -} - -/** - * Purpose: updateStoredUserInfo supports auth.js by holding or executing the update stored user info page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function updateStoredUserInfo(userInfo) { - if (!userInfo) { - removeStorage(STORAGE_KEYS.USER_INFO) - return - } - - setStorage(STORAGE_KEYS.USER_INFO, userInfo) -} - -/** - * Purpose: setPermissions supports auth.js by holding or executing the set permissions page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function setPermissions(permissions) { - setStorage(STORAGE_KEYS.PERMISSIONS, Array.isArray(permissions) ? permissions : []) -} - -/** - * Purpose: clearPermissions supports auth.js by holding or executing the clear permissions page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function clearPermissions() { - removeStorage(STORAGE_KEYS.PERMISSIONS) -} - -/** - * Purpose: setCurrentShop supports auth.js by holding or executing the set current shop page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function setCurrentShop(shop) { - if (!shop || !shop.id) { - removeStorage(STORAGE_KEYS.CURRENT_SHOP) - return - } - - setStorage(STORAGE_KEYS.CURRENT_SHOP, { - id: shop.id, - shopName: shop.shopName || '' - }) -} - -/** - * Purpose: clearSession supports auth.js by holding or executing the clear session page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function clearSession() { - removeStorage(STORAGE_KEYS.ACCESS_TOKEN) - removeStorage(STORAGE_KEYS.REFRESH_TOKEN) - removeStorage(STORAGE_KEYS.USER_INFO) - removeStorage(STORAGE_KEYS.PERMISSIONS) - removeStorage(STORAGE_KEYS.CURRENT_SHOP) -} - -module.exports = { - getAccessToken, - getRefreshToken, - getStoredUserInfo, - getStoredPermissions, - getCurrentShop, - isLoggedIn, - setSession, - updateStoredUserInfo, - setPermissions, - clearPermissions, - setCurrentShop, - clearSession -} diff --git a/FD-WeChat-Fronted/admin/utils/cache.js b/FD-WeChat-Fronted/admin/utils/cache.js deleted file mode 100644 index cdd451af..00000000 --- a/FD-WeChat-Fronted/admin/utils/cache.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Purpose: CACHE_PREFIX supports cache.js by holding or executing the cache prefix page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const CACHE_PREFIX = 'adminMiniCache:' -/** - * Purpose: memoryCache supports cache.js by holding or executing the memory cache page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const memoryCache = {} -/** - * Purpose: inflightCache supports cache.js by holding or executing the inflight cache page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const inflightCache = {} - -/** - * Purpose: buildKey supports cache.js by holding or executing the build key page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildKey(key) { - return `${CACHE_PREFIX}${key}` -} - -/** - * Purpose: now supports cache.js by holding or executing the now page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function now() { - return Date.now() -} - -/** - * Purpose: getCache supports cache.js by holding or executing the get cache page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getCache(key, defaultValue) { - if (!key) { - return defaultValue - } - - const memoryEntry = memoryCache[key] - if (memoryEntry && (!memoryEntry.expireAt || memoryEntry.expireAt > now())) { - return memoryEntry.value - } - delete memoryCache[key] - - try { - const storedEntry = wx.getStorageSync(buildKey(key)) - if (storedEntry && (!storedEntry.expireAt || storedEntry.expireAt > now())) { - memoryCache[key] = storedEntry - return storedEntry.value - } - wx.removeStorageSync(buildKey(key)) - } catch (error) {} - - return defaultValue -} - -/** - * Purpose: setCache supports cache.js by holding or executing the set cache page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function setCache(key, value, ttlMs) { - if (!key) { - return value - } - const entry = { - value, - expireAt: ttlMs && ttlMs > 0 ? now() + ttlMs : 0 - } - memoryCache[key] = entry - try { - wx.setStorageSync(buildKey(key), entry) - } catch (error) {} - return value -} - -/** - * Purpose: removeCache supports cache.js by holding or executing the remove cache page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function removeCache(key) { - if (!key) { - return - } - delete memoryCache[key] - try { - wx.removeStorageSync(buildKey(key)) - } catch (error) {} -} - -/** - * Purpose: remember supports cache.js by holding or executing the remember page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function remember(key, ttlMs, loader) { - const cached = getCache(key, undefined) - if (cached !== undefined) { - return Promise.resolve(cached) - } - if (inflightCache[key]) { - return inflightCache[key] - } - inflightCache[key] = Promise.resolve() - .then(() => loader()) - .then(value => setCache(key, value, ttlMs)) - .finally(() => { - delete inflightCache[key] - }) - return inflightCache[key] -} - -module.exports = { - getCache, - setCache, - removeCache, - remember -} diff --git a/FD-WeChat-Fronted/admin/utils/config.js b/FD-WeChat-Fronted/admin/utils/config.js deleted file mode 100644 index 06f35ddc..00000000 --- a/FD-WeChat-Fronted/admin/utils/config.js +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Purpose: safeRequire supports config.js by holding or executing the safe require page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function safeRequire(modulePath) { - try { - return require(modulePath) - } catch (error) { - return {} - } -} - -/** - * Purpose: getEnvVersion supports config.js by holding or executing the get env version page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getEnvVersion() { - if (typeof wx === 'undefined') { - return 'develop' - } - - try { - if (typeof wx.getAccountInfoSync === 'function') { - const accountInfo = wx.getAccountInfoSync() - const miniProgram = accountInfo && accountInfo.miniProgram - if (miniProgram && miniProgram.envVersion) { - return miniProgram.envVersion - } - } - } catch (error) {} - - return 'develop' -} - -/** - * Purpose: getRuntimePlatform supports config.js by holding or executing the get runtime platform page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getRuntimePlatform() { - if (typeof wx === 'undefined') { - return 'devtools' - } - - try { - const systemInfo = wx.getSystemInfoSync() - if (systemInfo && systemInfo.platform) { - return systemInfo.platform - } - } catch (error) {} - - return 'unknown' -} - -/** - * Purpose: normalizeDomain supports config.js by holding or executing the normalize domain page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function normalizeDomain(value, fallbackValue) { - const target = String(value || fallbackValue || '').trim() - return target.replace(/\/+$/, '') -} - -/** - * Purpose: ensureHttps supports config.js by holding or executing the ensure https page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function ensureHttps(value, envVersion) { - if (!value) { - throw new Error(`Missing API domain for ${envVersion}`) - } - if (envVersion !== 'develop' && !value.startsWith('https://')) { - throw new Error(`${envVersion} environment must use HTTPS`) - } - return value -} - -/** - * Purpose: localOverride supports config.js by holding or executing the local override page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const localOverride = safeRequire('./config.local') -/** - * Purpose: ENV_VERSION supports config.js by holding or executing the env version page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const ENV_VERSION = getEnvVersion() -/** - * Purpose: RUNTIME_PLATFORM supports config.js by holding or executing the runtime platform page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const RUNTIME_PLATFORM = getRuntimePlatform() -/** - * Purpose: IS_DEVTOOLS supports config.js by holding or executing the is devtools page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const IS_DEVTOOLS = RUNTIME_PLATFORM === 'devtools' - -/** - * Purpose: DEFAULT_DOMAINS supports config.js by holding or executing the default domains page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const DEFAULT_DOMAINS = { - local: 'http://127.0.0.1:80', - tunnel: 'https://yunail.art', - 'dev-remote': 'https://yunail.art', - trial: 'https://yunail.art', - release: 'https://yunail.art' -} - -/** - * Purpose: DOMAIN_MAP supports config.js by holding or executing the domain map page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const DOMAIN_MAP = { - ...DEFAULT_DOMAINS, - ...(localOverride.domains || {}) -} - -/** - * Purpose: DEFAULT_DEVELOP_TARGET supports config.js by holding or executing the default develop target page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const DEFAULT_DEVELOP_TARGET = IS_DEVTOOLS ? 'local' : 'dev-remote' -/** - * Purpose: DEVELOP_TARGET supports config.js by holding or executing the develop target page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const DEVELOP_TARGET = String(localOverride.developTarget || DEFAULT_DEVELOP_TARGET) -/** - * Purpose: API_DOMAIN supports config.js by holding or executing the api domain page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const API_DOMAIN = ensureHttps( - ENV_VERSION === 'develop' - ? normalizeDomain(DOMAIN_MAP[DEVELOP_TARGET], DOMAIN_MAP['dev-remote']) - : normalizeDomain(DOMAIN_MAP[ENV_VERSION], DOMAIN_MAP.release), - ENV_VERSION -) - -module.exports = { - ENV_VERSION, - RUNTIME_PLATFORM, - IS_DEVTOOLS, - DEVELOP_TARGET, - API_DOMAIN, - ADMIN_API_BASE_URL: `${API_DOMAIN}/admin/api`, - IS_DEV_ENV: ENV_VERSION === 'develop', - REQUEST_TIMEOUT: Number(localOverride.requestTimeout || 10000), - ENABLE_REQUEST_SIGNING: localOverride.enableRequestSigning !== false, - IDLE_TIMEOUT_MS: 30 * 60 * 1000, - IDLE_WARNING_MS: 2 * 60 * 1000, - CACHE_TTL: { - permissions: 2 * 60 * 1000, - dict: 5 * 60 * 1000, - workbench: 60 * 1000 - }, - TAB_PAGES: [ - '/admin/pages/workbench/index', - '/admin/pages/orders/index', - '/admin/pages/manage/index', - '/admin/pages/profile/index' - ] -} diff --git a/FD-WeChat-Fronted/admin/utils/config.local.example.js b/FD-WeChat-Fronted/admin/utils/config.local.example.js deleted file mode 100644 index 4633d2c4..00000000 --- a/FD-WeChat-Fronted/admin/utils/config.local.example.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - developTarget: 'local', - requestTimeout: 10000, - enableRequestSigning: true, - domains: { - local: 'http://127.0.0.1:80', - tunnel: 'https://yunail.art', - 'dev-remote': 'https://yunail.art', - trial: 'https://yunail.art', - release: 'https://yunail.art' - } -} diff --git a/FD-WeChat-Fronted/admin/utils/device.js b/FD-WeChat-Fronted/admin/utils/device.js deleted file mode 100644 index 9a634dd2..00000000 --- a/FD-WeChat-Fronted/admin/utils/device.js +++ /dev/null @@ -1,28 +0,0 @@ -const { STORAGE_KEYS, getStorage, setStorage } = require('./storage') - -/** - * Purpose: createDeviceId supports device.js by holding or executing the create device id page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function createDeviceId() { - const randomText = Math.random().toString(36).slice(2, 10) - return `admin-mini-device-${Date.now()}-${randomText}` -} - -/** - * Purpose: getDeviceId supports device.js by holding or executing the get device id page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getDeviceId() { - let value = getStorage(STORAGE_KEYS.DEVICE_ID, '') - if (value) { - return value - } - value = createDeviceId() - setStorage(STORAGE_KEYS.DEVICE_ID, value) - return value -} - -module.exports = { - getDeviceId -} diff --git a/FD-WeChat-Fronted/admin/utils/form-draft.js b/FD-WeChat-Fronted/admin/utils/form-draft.js deleted file mode 100644 index f56168cb..00000000 --- a/FD-WeChat-Fronted/admin/utils/form-draft.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Purpose: DRAFT_PREFIX supports form-draft.js by holding or executing the draft prefix page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const DRAFT_PREFIX = 'adminMiniDraft:' - -/** - * Purpose: buildDraftKey supports form-draft.js by holding or executing the build draft key page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildDraftKey(key) { - return `${DRAFT_PREFIX}${key}` -} - -/** - * Purpose: getDraftValue supports form-draft.js by holding or executing the get draft value page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getDraftValue(key, defaultValue) { - if (!key) { - return defaultValue - } - try { - const record = wx.getStorageSync(buildDraftKey(key)) - if (!record || typeof record !== 'object' || !Object.prototype.hasOwnProperty.call(record, 'value')) { - return defaultValue - } - return record.value - } catch (error) { - return defaultValue - } -} - -/** - * Purpose: saveDraft supports form-draft.js by holding or executing the save draft page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function saveDraft(key, value) { - if (!key) { - return - } - try { - wx.setStorageSync(buildDraftKey(key), { - savedAt: Date.now(), - value - }) - } catch (error) {} -} - -/** - * Purpose: clearDraft supports form-draft.js by holding or executing the clear draft page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function clearDraft(key) { - if (!key) { - return - } - try { - wx.removeStorageSync(buildDraftKey(key)) - } catch (error) {} -} - -/** - * Purpose: scheduleDraftSave supports form-draft.js by holding or executing the schedule draft save page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function scheduleDraftSave(context, key, buildValue, delay) { - if (!context) { - return - } - if (context.__draftSaveTimer) { - clearTimeout(context.__draftSaveTimer) - } - context.__draftSaveTimer = setTimeout(() => { - saveDraft(key, buildValue()) - }, delay || 300) -} - -/** - * Purpose: clearDraftTimer supports form-draft.js by holding or executing the clear draft timer page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function clearDraftTimer(context) { - if (context && context.__draftSaveTimer) { - clearTimeout(context.__draftSaveTimer) - context.__draftSaveTimer = null - } -} - -module.exports = { - getDraftValue, - saveDraft, - clearDraft, - scheduleDraftSave, - clearDraftTimer -} diff --git a/FD-WeChat-Fronted/admin/utils/format.js b/FD-WeChat-Fronted/admin/utils/format.js deleted file mode 100644 index e0c7f7c1..00000000 --- a/FD-WeChat-Fronted/admin/utils/format.js +++ /dev/null @@ -1,212 +0,0 @@ -/** - * Purpose: toIdString supports format.js by holding or executing the to id string page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function toIdString(value) { - return value === undefined || value === null ? '' : String(value) -} - -/** - * Purpose: sameId supports format.js by holding or executing the same id page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function sameId(left, right) { - return toIdString(left) === toIdString(right) -} - -/** - * Purpose: splitCsv supports format.js by holding or executing the split csv page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function splitCsv(value) { - return String(value || '') - .split(',') - .map(item => item.trim()) - .filter(Boolean) -} - -/** - * Purpose: formatPrice supports format.js by holding or executing the format price page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function formatPrice(value) { - return Number(value || 0).toFixed(2) -} - -/** - * Purpose: formatDateTime supports format.js by holding or executing the format date time page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function formatDateTime(value) { - if (!value) { - return '' - } - - return String(value).replace('T', ' ').slice(0, 16) -} - -/** - * Purpose: formatDate supports format.js by holding or executing the format date page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function formatDate(value) { - return formatDateTime(value).slice(0, 10) -} - -/** - * Purpose: maskPhone supports format.js by holding or executing the mask phone page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function maskPhone(phone) { - const value = String(phone || '') - if (value.length !== 11) { - return value - } - return `${value.slice(0, 3)}****${value.slice(7)}` -} - -/** - * Purpose: truncateText supports format.js by holding or executing the truncate text page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function truncateText(value, limit) { - const text = String(value || '') - if (!limit || text.length <= limit) { - return text - } - return `${text.slice(0, limit)}...` -} - -/** - * Purpose: buildShopName supports format.js by holding or executing the build shop name page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildShopName(record) { - if (!record) { - return '未绑定店铺' - } - - if (Array.isArray(record.shopNames) && record.shopNames.length) { - return record.shopNames.join(' / ') - } - - if (record.shopName) { - return record.shopName - } - - return '未绑定店铺' -} - -/** - * Purpose: getUserStatusText supports format.js by holding or executing the get user status text page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getUserStatusText(status) { - return Number(status) === 0 ? '已停用' : '正常' -} - -/** - * Purpose: getUserTypeText supports format.js by holding or executing the get user type text page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getUserTypeText(type) { - const value = Number(type) - if (value === 4) { - return '平台管理员' - } - if (value === 2) { - return '店长' - } - if (value === 3) { - return '美甲师' - } - return '普通用户' -} - -/** - * Purpose: getOrderStatusText supports format.js by holding or executing the get order status text page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getOrderStatusText(order) { - if (order && order.statusText) { - return order.statusText - } - - const status = Number(order && order.status) - if (status === 1) { - return '待服务' - } - if (status === 2) { - return '已完成' - } - return '已取消' -} - -/** - * Purpose: getCouponTypeText supports format.js by holding or executing the get coupon type text page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getCouponTypeText(type) { - return Number(type) === 1 ? '折扣券' : '满减券' -} - -/** - * Purpose: getCouponValueText supports format.js by holding or executing the get coupon value text page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getCouponValueText(coupon) { - if (Number(coupon && coupon.couponType) === 1) { - return `${coupon && coupon.discountValue ? coupon.discountValue : '--'} 折` - } - return `满 ${formatPrice(coupon && coupon.minAmount)} 减 ${formatPrice(coupon && coupon.reduceAmount)}` -} - -/** - * Purpose: parseDateTimeToPicker supports format.js by holding or executing the parse date time to picker page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function parseDateTimeToPicker(value) { - const text = formatDateTime(value) - if (!text) { - return { - date: '', - time: '' - } - } - - const parts = text.split(' ') - return { - date: parts[0] || '', - time: (parts[1] || '').slice(0, 5) - } -} - -/** - * Purpose: buildDateTime supports format.js by holding or executing the build date time page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildDateTime(date, time) { - if (!date || !time) { - return '' - } - return `${date} ${time}:00` -} - -module.exports = { - toIdString, - sameId, - splitCsv, - formatPrice, - formatDateTime, - formatDate, - maskPhone, - truncateText, - buildShopName, - getUserStatusText, - getUserTypeText, - getOrderStatusText, - getCouponTypeText, - getCouponValueText, - parseDateTimeToPicker, - buildDateTime -} diff --git a/FD-WeChat-Fronted/admin/utils/loading.js b/FD-WeChat-Fronted/admin/utils/loading.js deleted file mode 100644 index 4161864a..00000000 --- a/FD-WeChat-Fronted/admin/utils/loading.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Purpose: activeLoadingCount supports loading.js by holding or executing the active loading count page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let activeLoadingCount = 0 - -/** - * Purpose: showLoading supports loading.js by holding or executing the show loading page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function showLoading(options) { - const config = options || {} - activeLoadingCount += 1 - - if (activeLoadingCount > 1) { - return - } - - wx.showLoading({ - title: config.title || '加载中', - mask: config.mask !== false - }) -} - -/** - * Purpose: hideLoading supports loading.js by holding or executing the hide loading page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function hideLoading() { - activeLoadingCount = Math.max(0, activeLoadingCount - 1) - - if (activeLoadingCount > 0) { - return - } - - wx.hideLoading({ - fail() {} - }) -} - -/** - * Purpose: resetLoading supports loading.js by holding or executing the reset loading page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function resetLoading() { - activeLoadingCount = 0 - wx.hideLoading({ - fail() {} - }) -} - -/** - * Purpose: runWithLoading supports loading.js by holding or executing the run with loading page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function runWithLoading(task, options) { - showLoading(options) - - return Promise.resolve() - .then(() => task()) - .finally(() => { - hideLoading() - }) -} - -module.exports = { - showLoading, - hideLoading, - resetLoading, - runWithLoading -} diff --git a/FD-WeChat-Fronted/admin/utils/navigation.js b/FD-WeChat-Fronted/admin/utils/navigation.js deleted file mode 100644 index 55190733..00000000 --- a/FD-WeChat-Fronted/admin/utils/navigation.js +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Purpose: auth supports navigation.js by holding or executing the auth page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const auth = require('./auth') -const { TAB_PAGES } = require('./config') - -const ADMIN_PAGE_PREFIX = '/admin/pages/' -const ADMIN_TAB_PAGES = TAB_PAGES - -/** - * Purpose: buildUrl supports navigation.js by holding or executing the build url page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildUrl(path, params) { - const query = Object.keys(params || {}) - .filter(key => params[key] !== undefined && params[key] !== null && params[key] !== '') - .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`) - .join('&') - - return query ? `${path}${String(path).includes('?') ? '&' : '?'}${query}` : path -} - -function splitUrl(value) { - const target = String(value || '') - const queryIndex = target.indexOf('?') - if (queryIndex < 0) { - return { - path: target, - query: '' - } - } - return { - path: target.slice(0, queryIndex), - query: target.slice(queryIndex) - } -} - -function toAdminPagePath(value) { - const { path, query } = splitUrl(value) - if (path.startsWith(ADMIN_PAGE_PREFIX)) { - return `${path}${query}` - } - if (path.startsWith('/pages/')) { - return `/admin${path}${query}` - } - return `${path}${query}` -} - -/** - * Purpose: getCurrentPageUrl supports navigation.js by holding or executing the get current page url page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getCurrentPageUrl() { - const pages = getCurrentPages() - const current = pages[pages.length - 1] - if (!current) { - return '/admin/pages/workbench/index' - } - - return buildUrl(`/${current.route}`, current.options || {}) -} - -/** - * Purpose: isTabPage supports navigation.js by holding or executing the is tab page page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function isTabPage(path) { - const purePath = String(toAdminPagePath(path) || '').split('?')[0] - return ADMIN_TAB_PAGES.includes(purePath) -} - -/** - * Purpose: navigate supports navigation.js by holding or executing the navigate page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function navigate(path, params) { - return new Promise((resolve, reject) => { - wx.navigateTo({ - url: toAdminPagePath(buildUrl(path, params)), - success: resolve, - fail: reject - }) - }) -} - -/** - * Purpose: redirect supports navigation.js by holding or executing the redirect page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function redirect(path, params) { - return new Promise((resolve, reject) => { - wx.redirectTo({ - url: toAdminPagePath(buildUrl(path, params)), - success: resolve, - fail: reject - }) - }) -} - -/** - * Purpose: switchTab keeps the old admin-tab API while using page redirects in the unified mini-program. - * Usage: call it for admin workbench/orders/manage/profile root pages; these pages are no longer native tabBar entries. - */ -function switchTab(path) { - const target = toAdminPagePath(path) - return new Promise((resolve, reject) => { - wx.redirectTo({ - url: target, - success: resolve, - fail(error) { - wx.reLaunch({ - url: target, - success: resolve, - fail: reject - }) - } - }) - }) -} - -/** - * Purpose: goBack supports navigation.js by holding or executing the go back page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function goBack(fallbackPath) { - const pages = getCurrentPages() - if (pages.length > 1) { - wx.navigateBack() - return - } - - const target = toAdminPagePath(fallbackPath || '/pages/workbench/index') - if (isTabPage(target)) { - switchTab(target) - return - } - - wx.redirectTo({ url: target }) -} - -/** - * Purpose: decodeRedirectValue supports navigation.js by holding or executing the decode redirect value page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function decodeRedirectValue(value) { - let current = String(value || '') - - for (let index = 0; index < 3; index += 1) { - try { - const decoded = decodeURIComponent(current) - if (decoded === current) { - return decoded - } - current = decoded - } catch (error) { - return current - } - } - - return current -} - -/** - * Purpose: redirectAfterLogin supports navigation.js by holding or executing the redirect after login page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function redirectAfterLogin(redirectValue) { - const target = redirectValue ? toAdminPagePath(decodeRedirectValue(redirectValue)) : '' - if (!target) { - return switchTab('/pages/workbench/index') - } - - const purePath = target.split('?')[0] - if (isTabPage(target)) { - return switchTab(purePath) - } - - return redirect(target) -} - -/** - * Purpose: openLogin supports navigation.js by holding or executing the open login page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function openLogin(redirectPath) { - return navigate('/pages/login/index', { - redirect: redirectPath ? toAdminPagePath(redirectPath) : getCurrentPageUrl() - }) -} - -/** - * Purpose: ensureLogin supports navigation.js by holding or executing the ensure login page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function ensureLogin(actionText) { - if (auth.isLoggedIn()) { - return true - } - - wx.showToast({ - title: `${actionText || '继续操作'}前请先登录`, - icon: 'none' - }) - - setTimeout(() => { - openLogin() - }, 160) - - return false -} - -module.exports = { - ADMIN_TAB_PAGES, - buildUrl, - getCurrentPageUrl, - isTabPage, - toAdminPagePath, - navigate, - redirect, - switchTab, - goBack, - redirectAfterLogin, - openLogin, - ensureLogin -} diff --git a/FD-WeChat-Fronted/admin/utils/navigation.test.js b/FD-WeChat-Fronted/admin/utils/navigation.test.js deleted file mode 100644 index 9e9b9a71..00000000 --- a/FD-WeChat-Fronted/admin/utils/navigation.test.js +++ /dev/null @@ -1,44 +0,0 @@ -const assert = require('assert') -const navigation = require('./navigation') - -assert.strictEqual( - navigation.toAdminPagePath('/pages/orders/index'), - '/admin/pages/orders/index' -) - -assert.strictEqual( - navigation.toAdminPagePath('/pages/order-detail/index?id=10'), - '/admin/pages/order-detail/index?id=10' -) - -assert.strictEqual( - navigation.toAdminPagePath('/admin/pages/manage/index'), - '/admin/pages/manage/index' -) - -assert.ok(navigation.ADMIN_TAB_PAGES.includes('/admin/pages/workbench/index')) -assert.ok(navigation.ADMIN_TAB_PAGES.includes('/admin/pages/orders/index')) -assert.ok(navigation.ADMIN_TAB_PAGES.includes('/admin/pages/manage/index')) -assert.ok(navigation.ADMIN_TAB_PAGES.includes('/admin/pages/profile/index')) - -let redirectedTo = '' -let relaunchedTo = '' - -global.wx = { - redirectTo(options) { - redirectedTo = options.url - if (typeof options.success === 'function') { - options.success() - } - }, - reLaunch(options) { - relaunchedTo = options.url - if (typeof options.success === 'function') { - options.success() - } - } -} - -navigation.redirectAfterLogin('') -assert.strictEqual(redirectedTo, '/admin/pages/workbench/index') -assert.strictEqual(relaunchedTo, '') diff --git a/FD-WeChat-Fronted/admin/utils/page-state.js b/FD-WeChat-Fronted/admin/utils/page-state.js deleted file mode 100644 index 92eb45f6..00000000 --- a/FD-WeChat-Fronted/admin/utils/page-state.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Purpose: ensureStore supports page-state.js by holding or executing the ensure store page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function ensureStore() { - const app = getApp() - app.globalData.pageDirtyFlags = app.globalData.pageDirtyFlags || {} - return app.globalData.pageDirtyFlags -} - -/** - * Purpose: markDirty supports page-state.js by holding or executing the mark dirty page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function markDirty(key) { - if (!key) { - return - } - const store = ensureStore() - store[key] = true -} - -/** - * Purpose: consumeDirty supports page-state.js by holding or executing the consume dirty page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function consumeDirty(key) { - if (!key) { - return false - } - const store = ensureStore() - const value = Boolean(store[key]) - delete store[key] - return value -} - -module.exports = { - markDirty, - consumeDirty -} diff --git a/FD-WeChat-Fronted/admin/utils/permission.js b/FD-WeChat-Fronted/admin/utils/permission.js deleted file mode 100644 index b6e318ff..00000000 --- a/FD-WeChat-Fronted/admin/utils/permission.js +++ /dev/null @@ -1,295 +0,0 @@ -/** - * Purpose: MANAGE_MODULES supports permission.js by holding or executing the manage modules page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const MANAGE_MODULES = [ - { - key: 'users', - title: '用户管理', - description: '用户资料、停用删除、解绑、余额与 VIP', - path: '/pages/users/index', - permissionCodes: ['user:view'], - requiresShopContext: false - }, - { - key: 'products', - title: '作品管理', - description: '作品新增、编辑、图片上传、点赞收藏维护', - path: '/pages/products/index', - permissionCodes: ['product:view'], - requiresShopContext: true - }, - { - key: 'coupons', - title: '优惠券', - description: '普通券、VIP 自动券、发放与活动配置', - path: '/pages/coupons/index', - permissionCodes: ['coupon:view'], - requiresShopContext: true - }, - { - key: 'comments', - title: '评论管理', - description: '查看作品评论与回复,删除不合规内容', - path: '/pages/comments/index', - permissionCodes: ['comment:view'], - requiresShopContext: true - }, - { - key: 'tags', - title: '标签管理', - description: '店铺标签、颜色配置与作品关联', - path: '/pages/tags/index', - permissionCodes: ['tag:view'], - requiresShopContext: true - }, - { - key: 'artists', - title: '美甲师', - description: '美甲师资料、档期信息与作品绑定', - path: '/pages/artists/index', - permissionCodes: ['nail_artist:view'], - requiresShopContext: true - }, - { - key: 'schedules', - title: '排班管理', - description: '查看和维护美甲师班次、休息日与预约容量', - path: '/pages/schedules/index', - permissionCodes: ['schedule:view'], - requiresShopContext: true - }, - { - key: 'afterSales', - title: '售后处理', - description: '查看售后申请,完成同意、驳回和处理说明', - path: '/pages/after-sales/index', - permissionCodes: ['after_sale:view'], - requiresShopContext: true - }, - { - key: 'inventory', - title: '库存管理', - description: '查看耗材库存、预警并快速调整入库出库', - path: '/pages/inventory/index', - permissionCodes: ['inventory:view'], - requiresShopContext: true - }, - { - key: 'campaigns', - title: '活动管理', - description: '查看营销活动、推荐位和轻量活动配置', - path: '/pages/campaigns/index', - permissionCodes: ['campaign:view'], - requiresShopContext: true - }, - { - key: 'shops', - title: '店铺管理', - description: '门店创建、启停、轮播图与店铺信息维护', - path: '/pages/shops/index', - permissionCodes: ['shop:view'], - requiresShopContext: false - }, - { - key: 'permissions', - title: '权限管理', - description: '权限字典、用户授权与范围控制', - path: '/pages/permissions/index', - permissionCodes: ['permission:view'], - requiresShopContext: false - }, - { - key: 'systemMessages', - title: '系统消息', - description: '发布消息、查看弹窗配置和业务跳转信息', - path: '/pages/system-messages/index', - permissionCodes: ['message:view'], - requiresShopContext: false - }, - { - key: 'securityAudit', - title: '审计日志', - description: '查看高危操作的成功、失败原因与操作者', - path: '/pages/security-audit/index', - permissionCodes: ['security:audit:view'], - requiresShopContext: false - } -] - -/** - * Purpose: getPermissionCodes supports permission.js by holding or executing the get permission codes page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getPermissionCodes(source) { - const list = Array.isArray(source) ? source : [] - - return list - .map(item => { - if (typeof item === 'string') { - return item - } - return item && item.permissionCode ? item.permissionCode : '' - }) - .filter(Boolean) -} - -/** - * Purpose: hasPermission supports permission.js by holding or executing the has permission page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function hasPermission(source, permissionCode) { - if (!permissionCode) { - return true - } - - const codes = getPermissionCodes(source) - return codes.includes(permissionCode) -} - -/** - * Purpose: hasAnyPermission supports permission.js by holding or executing the has any permission page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function hasAnyPermission(source, permissionCodes) { - const codes = Array.isArray(permissionCodes) ? permissionCodes : [] - if (!codes.length) { - return true - } - - return codes.some(code => hasPermission(source, code)) -} - -/** - * Purpose: hasAllPermissions supports permission.js by holding or executing the has all permissions page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function hasAllPermissions(source, permissionCodes) { - const codes = Array.isArray(permissionCodes) ? permissionCodes : [] - if (!codes.length) { - return true - } - - return codes.every(code => hasPermission(source, code)) -} - -/** - * Purpose: isPlatformAdmin supports permission.js by holding or executing the is platform admin page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function isPlatformAdmin(userInfo) { - return Number(userInfo && userInfo.type) === 4 -} - -/** - * Purpose: isShopManager supports permission.js by holding or executing the is shop manager page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function isShopManager(userInfo) { - return Number(userInfo && userInfo.type) === 2 -} - -/** - * Purpose: isNailArtist supports permission.js by holding or executing the is nail artist page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function isNailArtist(userInfo) { - return Number(userInfo && userInfo.type) === 3 -} - -/** - * Purpose: getRoleLabel supports permission.js by holding or executing the get role label page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getRoleLabel(type) { - const value = Number(type) - if (value === 4) { - return '平台管理员' - } - if (value === 2) { - return '店长' - } - if (value === 3) { - return '美甲师' - } - return '用户' -} - -/** - * Purpose: groupPermissionsByGroup supports permission.js by holding or executing the group permissions by group page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function groupPermissionsByGroup(permissions) { - return (Array.isArray(permissions) ? permissions : []).reduce((result, item) => { - const group = item && item.permissionGroup ? item.permissionGroup : '未分组' - if (!result[group]) { - result[group] = [] - } - result[group].push(item) - return result - }, {}) -} - -/** - * Purpose: checkModuleAccess supports permission.js by holding or executing the check module access page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function checkModuleAccess(module, userInfo, permissionCodes, currentShop) { - if (!hasAnyPermission(permissionCodes, module.permissionCodes)) { - return { - allowed: false, - reason: '当前账号没有该板块权限' - } - } - - if (module.requiresShopContext && !currentShop) { - if (isPlatformAdmin(userInfo)) { - return { - allowed: true, - reason: '平台总览模式下该模块仅可查看,编辑操作已关闭', - readonly: true - } - } - - return { - allowed: false, - reason: '当前账号没有可用店铺' - } - } - - return { - allowed: true, - reason: '' - } -} - -/** - * Purpose: getManageModules supports permission.js by holding or executing the get manage modules page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getManageModules(userInfo, permissionCodes, currentShop) { - return MANAGE_MODULES.map(module => { - const access = checkModuleAccess(module, userInfo, permissionCodes, currentShop) - return { - ...module, - allowed: access.allowed, - readonly: Boolean(access.readonly), - disabledReason: access.reason - } - }) -} - -module.exports = { - MANAGE_MODULES, - getPermissionCodes, - hasPermission, - hasAnyPermission, - hasAllPermissions, - isPlatformAdmin, - isShopManager, - isNailArtist, - getRoleLabel, - groupPermissionsByGroup, - checkModuleAccess, - getManageModules -} diff --git a/FD-WeChat-Fronted/admin/utils/request.js b/FD-WeChat-Fronted/admin/utils/request.js deleted file mode 100644 index 2b38a534..00000000 --- a/FD-WeChat-Fronted/admin/utils/request.js +++ /dev/null @@ -1,560 +0,0 @@ -/** - * Purpose: auth supports request.js by holding or executing the auth page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const auth = require('./auth') -/** - * Purpose: actionGuard supports request.js by holding or executing the action guard page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const actionGuard = require('./action-guard') -/** - * Purpose: idleSession supports request.js by holding or executing the idle session page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const idleSession = require('./idle-session') -const { ADMIN_API_BASE_URL, REQUEST_TIMEOUT, ENABLE_REQUEST_SIGNING } = require('./config') -const { getDeviceId } = require('./device') -const { sha256Hex, hmacSha256Hex, buildCanonicalParams, buildJsonPayload, randomNonce } = require('./crypto') - -/** - * Purpose: DEVICE_ID_HEADER supports request.js by holding or executing the device id header page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const DEVICE_ID_HEADER = 'X-Device-Id' -/** - * Purpose: HEADER_TIMESTAMP supports request.js by holding or executing the header timestamp page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const HEADER_TIMESTAMP = 'X-Timestamp' -/** - * Purpose: HEADER_NONCE supports request.js by holding or executing the header nonce page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const HEADER_NONCE = 'X-Nonce' -/** - * Purpose: HEADER_SIGNATURE supports request.js by holding or executing the header signature page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const HEADER_SIGNATURE = 'X-Signature' -/** - * Purpose: HEADER_SIGNATURE_VERSION supports request.js by holding or executing the header signature version page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const HEADER_SIGNATURE_VERSION = 'X-Sign-Version' - -/** - * Purpose: isRefreshing supports request.js by holding or executing the is refreshing page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let isRefreshing = false -/** - * Purpose: requestQueue supports request.js by holding or executing the request queue page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let requestQueue = [] -/** - * Purpose: redirectingToLogin supports request.js by holding or executing the redirecting to login page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let redirectingToLogin = false -/** - * Purpose: inflightRequests supports request.js by holding or executing the inflight requests page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const inflightRequests = {} - -/** - * Purpose: buildRequestUrl supports request.js by holding or executing the build request url page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildRequestUrl(url, params) { - const query = Object.keys(params || {}) - .filter(key => params[key] !== undefined && params[key] !== null && params[key] !== '') - .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`) - .join('&') - - const target = `${ADMIN_API_BASE_URL}${url}` - return query ? `${target}${target.includes('?') ? '&' : '?'}${query}` : target -} - -/** - * Purpose: extractPath supports request.js by holding or executing the extract path page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function extractPath(value) { - const target = String(value || '') - if (!target) { - return '' - } - if (/^[a-z][a-z\d+\-.]*:\/\//i.test(target)) { - try { - return new URL(target).pathname - } catch (error) {} - } - return target.split('?')[0] || '' -} - -/** - * Purpose: toBackendRequestPath supports request.js by holding or executing the to backend request path page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function toBackendRequestPath(url) { - const path = extractPath(url).replace(/\/+$/, '') || '/' - if (path === '/admin/api') { - return '/admin' - } - if (path.startsWith('/admin/api/')) { - return `/admin/${path.slice('/admin/api/'.length)}` - } - if (path === '/api/admin') { - return '/admin' - } - if (path.startsWith('/api/admin/')) { - return `/admin/${path.slice('/api/admin/'.length)}` - } - if (path === '/admin' || path.startsWith('/admin/')) { - return path - } - return path.startsWith('/') ? `/admin${path}` : `/admin/${path}` -} - -/** - * Purpose: isAuthFreePath supports request.js by holding or executing the is auth free path page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function isAuthFreePath(url) { - return [ - '/auth/login', - '/auth/refresh', - '/auth/login-shops/' - ].some(path => String(url || '').includes(path)) -} - -/** - * Purpose: normalizeError supports request.js by holding or executing the normalize error page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function normalizeError(message, statusCode, raw) { - const error = new Error(message || '\u8bf7\u6c42\u5931\u8d25') - error.statusCode = statusCode - error.raw = raw - return error -} - -/** - * Purpose: rawRequest supports request.js by holding or executing the raw request page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function rawRequest(options) { - idleSession.markActive() - return new Promise((resolve, reject) => { - wx.request({ - ...options, - success: resolve, - fail: reject - }) - }) -} - -/** - * Purpose: queueRequest supports request.js by holding or executing the queue request page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function queueRequest(retry) { - return new Promise((resolve, reject) => { - requestQueue.push({ - resolve, - reject, - retry - }) - }) -} - -/** - * Purpose: flushQueue supports request.js by holding or executing the flush queue page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function flushQueue(error) { - const queue = requestQueue.slice() - requestQueue = [] - - queue.forEach(item => { - if (error) { - item.reject(error) - return - } - item.retry().then(item.resolve).catch(item.reject) - }) -} - -/** - * Purpose: redirectToLogin supports request.js by holding or executing the redirect to login page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function redirectToLogin() { - if (redirectingToLogin) { - return - } - - const pages = getCurrentPages() - const current = pages[pages.length - 1] - if (current && current.route === 'admin/pages/login/index') { - return - } - - redirectingToLogin = true - - const currentPath = current ? `/${current.route}` : '/admin/pages/workbench/index' - const query = current && current.options ? current.options : {} - const queryString = Object.keys(query) - .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(query[key])}`) - .join('&') - const redirect = queryString ? `${currentPath}?${queryString}` : currentPath - - wx.showToast({ - title: '\u767b\u5f55\u5df2\u5931\u6548\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55', - icon: 'none' - }) - - setTimeout(() => { - wx.reLaunch({ - url: `/admin/pages/login/index?redirect=${encodeURIComponent(redirect)}`, - complete() { - redirectingToLogin = false - } - }) - }, 240) -} - -/** - * Purpose: buildSignatureHeaders supports request.js by holding or executing the build signature headers page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildSignatureHeaders(options) { - const headers = { - [DEVICE_ID_HEADER]: getDeviceId() - } - const method = String(options.method || 'GET').toUpperCase() - const accessToken = auth.getAccessToken() - if (accessToken && !isAuthFreePath(options.url)) { - headers.Authorization = `Bearer ${accessToken}` - } - - if (!ENABLE_REQUEST_SIGNING || !accessToken || isAuthFreePath(options.url) || ['GET', 'HEAD', 'OPTIONS'].includes(method)) { - return headers - } - - const formData = options.formData - const hasFormData = formData && Object.keys(formData).length > 0 - const contentType = String((options.header && options.header['Content-Type']) || options.contentType || 'application/json').toLowerCase() - const payload = contentType.includes('application/json') && !hasFormData - ? buildJsonPayload(options.data) - : buildCanonicalParams(formData || options.data || options.params) - const timestamp = String(Date.now()) - const nonce = randomNonce() - const canonical = [ - method, - toBackendRequestPath(options.url), - timestamp, - nonce, - sha256Hex(payload) - ].join('\n') - - headers[HEADER_TIMESTAMP] = timestamp - headers[HEADER_NONCE] = nonce - headers[HEADER_SIGNATURE] = hmacSha256Hex(accessToken, canonical) - headers[HEADER_SIGNATURE_VERSION] = 'v1' - return headers -} - -/** - * Purpose: refreshToken supports request.js by holding or executing the refresh token page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -async function refreshToken() { - const refreshTokenValue = auth.getRefreshToken() - if (!refreshTokenValue) { - throw normalizeError('\u7f3a\u5c11\u5237\u65b0\u4ee4\u724c', 401) - } - - const response = await rawRequest({ - url: `${ADMIN_API_BASE_URL}/auth/refresh`, - method: 'POST', - timeout: REQUEST_TIMEOUT, - header: { - 'Content-Type': 'application/json', - [DEVICE_ID_HEADER]: getDeviceId() - }, - data: { - refreshToken: refreshTokenValue - } - }) - - if (response.statusCode === 200 && response.data && response.data.code === 200 && response.data.data) { - auth.setSession(response.data.data) - const app = getApp() - if (app && typeof app.bootstrapAdminSession === 'function') { - app.bootstrapAdminSession() - } - return response.data.data - } - - throw normalizeError( - (response.data && response.data.message) || '\u5237\u65b0\u540e\u53f0\u767b\u5f55\u6001\u5931\u8d25', - response.statusCode, - response - ) -} - -/** - * Purpose: handleUnauthorized supports request.js by holding or executing the handle unauthorized page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -async function handleUnauthorized(options) { - if (options._retry || isAuthFreePath(options.url)) { - const app = getApp() - if (app && typeof app.clearAdminSession === 'function') { - app.clearAdminSession() - } else { - auth.clearSession() - } - redirectToLogin() - throw normalizeError('\u767b\u5f55\u5df2\u5931\u6548\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55', 401) - } - - if (isRefreshing) { - return queueRequest(() => request({ - ...options, - _retry: true - })) - } - - isRefreshing = true - try { - await refreshToken() - flushQueue(null) - return await request({ - ...options, - _retry: true - }) - } catch (error) { - flushQueue(error) - const app = getApp() - if (app && typeof app.clearAdminSession === 'function') { - app.clearAdminSession() - } else { - auth.clearSession() - } - redirectToLogin() - throw error - } finally { - isRefreshing = false - } -} - -/** - * Purpose: unwrapResponse supports request.js by holding or executing the unwrap response page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -async function unwrapResponse(response, options) { - idleSession.markActive() - - if (response.statusCode === 401) { - return handleUnauthorized(options) - } - - if (response.statusCode === 403) { - throw normalizeError( - (response.data && response.data.message) || '\u6743\u9650\u4e0d\u8db3', - response.statusCode, - response - ) - } - - if (response.statusCode >= 400) { - throw normalizeError( - (response.data && response.data.message) || '\u7f51\u7edc\u8bf7\u6c42\u5931\u8d25', - response.statusCode, - response - ) - } - - const payload = response.data - if (payload && typeof payload === 'object' && Object.prototype.hasOwnProperty.call(payload, 'code')) { - if (payload.code === 200) { - return payload.data - } - throw normalizeError(payload.message || '\u8bf7\u6c42\u5931\u8d25', payload.code, payload) - } - - return payload -} - -/** - * Purpose: buildDedupeKey supports request.js by holding or executing the build dedupe key page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildDedupeKey(options, method) { - if (options.skipDedupe) { - return '' - } - if (options.dedupeKey) { - return `${method}:${options.dedupeKey}` - } - if (method === 'GET') { - return `${method}:${options.url}:${buildCanonicalParams(options.params)}` - } - return '' -} - -/** - * Purpose: isSafeMethod supports request.js by holding or executing the is safe method page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function isSafeMethod(method) { - return ['GET', 'HEAD', 'OPTIONS'].includes(method) -} - -/** - * Purpose: buildActionFingerprint supports request.js by holding or executing the build action fingerprint page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildActionFingerprint(options, method) { - const paramsText = buildCanonicalParams(options.params) - const payloadText = isSafeMethod(method) ? '' : buildJsonPayload(options.data) - return sha256Hex([ - options.url || '', - paramsText, - payloadText - ].join('\n')) -} - -/** - * Purpose: resolveRepeatMessage supports request.js by holding or executing the resolve repeat message page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function resolveRepeatMessage(url) { - const path = String(url || '') - if (path.includes('/auth/login')) { - return '\u767b\u5f55\u5904\u7406\u4e2d\uff0c\u8bf7\u52ff\u91cd\u590d\u63d0\u4ea4' - } - if (path.includes('/auth/switch-shop')) { - return '\u95e8\u5e97\u5207\u6362\u4e2d\uff0c\u8bf7\u52ff\u91cd\u590d\u64cd\u4f5c' - } - if (path.includes('/auth/logout')) { - return '\u9000\u51fa\u5904\u7406\u4e2d\uff0c\u8bf7\u52ff\u91cd\u590d\u64cd\u4f5c' - } - if (path.includes('/coupon/distribute') || path.includes('/coupon/assign') || path.includes('/order/update-status')) { - return '\u64cd\u4f5c\u5904\u7406\u4e2d\uff0c\u8bf7\u52ff\u91cd\u590d\u63d0\u4ea4' - } - if (path.includes('/upload')) { - return '\u4e0a\u4f20\u5904\u7406\u4e2d\uff0c\u8bf7\u52ff\u91cd\u590d\u64cd\u4f5c' - } - if ( - path.includes('/user/create') - || path.includes('/user/update') - || path.includes('/product/create') - || path.includes('/product/update') - || path.includes('/shops/create') - || path.includes('/shops/update') - || path.includes('/tag/create') - || path.includes('/tag/update') - || path.includes('/permission/create') - || path.includes('/permission/update') - || path.includes('/nail-artist/save') - ) { - return '\u4fdd\u5b58\u5904\u7406\u4e2d\uff0c\u8bf7\u52ff\u91cd\u590d\u63d0\u4ea4' - } - return '\u64cd\u4f5c\u8fdb\u884c\u4e2d\uff0c\u8bf7\u52ff\u91cd\u590d\u70b9\u51fb' -} - -/** - * Purpose: buildActionGuardConfig supports request.js by holding or executing the build action guard config page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildActionGuardConfig(options, method) { - if (options.skipActionGuard || isSafeMethod(method)) { - return null - } - - return { - scope: options.guardScope, - key: options.actionKey || `${method}:${options.url}:${buildActionFingerprint(options, method)}`, - message: options.repeatMessage || resolveRepeatMessage(options.url) - } -} - -/** - * Purpose: request supports request.js by holding or executing the request page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function request(options) { - const method = String(options.method || 'GET').toUpperCase() - const dedupeKey = buildDedupeKey(options, method) - if (dedupeKey && inflightRequests[dedupeKey]) { - return inflightRequests[dedupeKey] - } - - const signatureHeaders = buildSignatureHeaders({ - url: options.url, - method, - data: options.data, - params: options.params, - header: options.header - }) - const header = { - 'Content-Type': 'application/json', - ...signatureHeaders, - ...(options.header || {}) - } - const requestOptions = { - ...options, - method, - header - } - const actionGuardConfig = buildActionGuardConfig(options, method) - - const executeRequest = () => new Promise((resolve, reject) => { - wx.request({ - url: buildRequestUrl(options.url, options.params), - method, - timeout: options.timeout || REQUEST_TIMEOUT, - header, - data: method === 'GET' ? undefined : options.data, - success: async response => { - try { - const data = await unwrapResponse(response, requestOptions) - resolve(data) - } catch (error) { - reject(error) - } - }, - fail: error => { - reject(normalizeError(error.errMsg || '\u7f51\u7edc\u5f02\u5e38\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5', 0, error)) - } - }) - }) - - const task = (actionGuardConfig - ? actionGuard.run(actionGuardConfig.scope, actionGuardConfig.key, executeRequest, { - message: actionGuardConfig.message - }) - : executeRequest() - ).finally(() => { - if (dedupeKey) { - delete inflightRequests[dedupeKey] - } - }) - - if (dedupeKey) { - inflightRequests[dedupeKey] = task - } - - return task -} - -request.buildSignatureHeaders = buildSignatureHeaders -request.getDeviceIdHeaderName = () => DEVICE_ID_HEADER - -module.exports = request diff --git a/FD-WeChat-Fronted/admin/utils/storage.js b/FD-WeChat-Fronted/admin/utils/storage.js deleted file mode 100644 index 2127b6eb..00000000 --- a/FD-WeChat-Fronted/admin/utils/storage.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Purpose: STORAGE_KEYS supports storage.js by holding or executing the storage keys page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const STORAGE_KEYS = { - ACCESS_TOKEN: 'adminAccessToken', - REFRESH_TOKEN: 'adminRefreshToken', - USER_INFO: 'adminUserInfo', - PERMISSIONS: 'adminPermissions', - CURRENT_SHOP: 'adminCurrentShop', - DEVICE_ID: 'adminMiniDeviceId' -} - -/** - * Purpose: TEMP_RECORD_PREFIX supports storage.js by holding or executing the temp record prefix page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const TEMP_RECORD_PREFIX = 'adminTempRecord:' - -/** - * Purpose: getStorage supports storage.js by holding or executing the get storage page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getStorage(key, defaultValue) { - try { - const value = wx.getStorageSync(key) - return value === '' || value === undefined ? defaultValue : value - } catch (error) { - return defaultValue - } -} - -/** - * Purpose: setStorage supports storage.js by holding or executing the set storage page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function setStorage(key, value) { - wx.setStorageSync(key, value) -} - -/** - * Purpose: removeStorage supports storage.js by holding or executing the remove storage page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function removeStorage(key) { - wx.removeStorageSync(key) -} - -/** - * Purpose: setTempRecord supports storage.js by holding or executing the set temp record page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function setTempRecord(name, value) { - setStorage(`${TEMP_RECORD_PREFIX}${name}`, value) -} - -/** - * Purpose: getTempRecord supports storage.js by holding or executing the get temp record page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getTempRecord(name, defaultValue) { - return getStorage(`${TEMP_RECORD_PREFIX}${name}`, defaultValue) -} - -/** - * Purpose: clearTempRecord supports storage.js by holding or executing the clear temp record page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function clearTempRecord(name) { - removeStorage(`${TEMP_RECORD_PREFIX}${name}`) -} - -module.exports = { - STORAGE_KEYS, - getStorage, - setStorage, - removeStorage, - setTempRecord, - getTempRecord, - clearTempRecord -} diff --git a/FD-WeChat-Fronted/admin/utils/upload.js b/FD-WeChat-Fronted/admin/utils/upload.js deleted file mode 100644 index f32466d3..00000000 --- a/FD-WeChat-Fronted/admin/utils/upload.js +++ /dev/null @@ -1,246 +0,0 @@ -/** - * Purpose: fileApi supports upload.js by holding or executing the file api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const fileApi = require('../api/file') - -/** - * Purpose: getFileSystemManager supports upload.js by holding or executing the get file system manager page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getFileSystemManager() { - return wx.getFileSystemManager() -} - -/** - * Purpose: getFileInfo supports upload.js by holding or executing the get file info page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getFileInfo(filePath) { - return new Promise((resolve, reject) => { - wx.getFileInfo({ - filePath, - success: resolve, - fail: reject - }) - }) -} - -/** - * Purpose: readFileBuffer supports upload.js by holding or executing the read file buffer page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function readFileBuffer(filePath) { - return new Promise((resolve, reject) => { - getFileSystemManager().readFile({ - filePath, - success: result => resolve(result.data), - fail: reject - }) - }) -} - -/** - * Purpose: writeChunkFile supports upload.js by holding or executing the write chunk file page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function writeChunkFile(filePath, data) { - return new Promise((resolve, reject) => { - getFileSystemManager().writeFile({ - filePath, - data, - encoding: 'binary', - success: resolve, - fail: reject - }) - }) -} - -/** - * Purpose: removeFile supports upload.js by holding or executing the remove file page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function removeFile(filePath) { - return new Promise(resolve => { - getFileSystemManager().unlink({ - filePath, - success: resolve, - fail: resolve - }) - }) -} - -/** - * Purpose: normalizeSelectedFiles supports upload.js by holding or executing the normalize selected files page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function normalizeSelectedFiles(files) { - return (Array.isArray(files) ? files : []).map((item, index) => { - if (typeof item === 'string') { - return { - tempFilePath: item, - fileName: `image-${index + 1}.jpg` - } - } - - return { - tempFilePath: item.tempFilePath || item.path || '', - fileName: item.fileName || item.name || `image-${index + 1}.jpg` - } - }).filter(item => item.tempFilePath) -} - -/** - * Purpose: createFingerprint supports upload.js by holding or executing the create fingerprint page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function createFingerprint(seed) { - let hash = 0 - const text = String(seed || '') - - for (let index = 0; index < text.length; index += 1) { - hash = ((hash << 5) - hash) + text.charCodeAt(index) - hash |= 0 - } - - return `mini-${Math.abs(hash)}` -} - -/** - * Purpose: resolveContentType supports upload.js by holding or executing the resolve content type page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function resolveContentType(fileName) { - const value = String(fileName || '').toLowerCase() - if (value.endsWith('.png')) { - return 'image/png' - } - if (value.endsWith('.webp')) { - return 'image/webp' - } - if (value.endsWith('.gif')) { - return 'image/gif' - } - return 'image/jpeg' -} - -/** - * Purpose: uploadSingleFile supports upload.js by holding or executing the upload single file page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -async function uploadSingleFile(file, scene, onProgress) { - const fileInfo = await getFileInfo(file.tempFilePath) - const buffer = await readFileBuffer(file.tempFilePath) - const contentType = resolveContentType(file.fileName) - const session = await fileApi.initChunkUpload({ - fileName: file.fileName, - fileSize: fileInfo.size, - contentType, - fileFingerprint: createFingerprint(`${file.fileName}|${fileInfo.size}|${file.tempFilePath}`), - scene - }) - - const uploadedChunkSet = new Set(session.uploadedChunks || []) - let uploadedBytes = 0 - const chunkSize = Number(session.chunkSize || 0) - const totalChunks = Number(session.totalChunks || 0) - - if (!chunkSize || !totalChunks) { - throw new Error('上传会话初始化失败') - } - - Array.from(uploadedChunkSet).forEach(chunkIndex => { - const start = chunkIndex * chunkSize - const end = Math.min(start + chunkSize, fileInfo.size) - uploadedBytes += Math.max(end - start, 0) - }) - - onProgress(Math.min((uploadedBytes / Math.max(fileInfo.size, 1)) * 100, 100)) - - for (let chunkIndex = 0; chunkIndex < totalChunks; chunkIndex += 1) { - if (uploadedChunkSet.has(chunkIndex)) { - continue - } - - const start = chunkIndex * chunkSize - const end = Math.min(start + chunkSize, fileInfo.size) - const chunkBuffer = buffer.slice(start, end) - const chunkPath = `${wx.env.USER_DATA_PATH}/${session.uploadId}-${chunkIndex}.part` - - await writeChunkFile(chunkPath, chunkBuffer) - - try { - await fileApi.uploadChunkFile({ - filePath: chunkPath, - uploadId: session.uploadId, - chunkIndex, - totalChunks, - onProgress(progress) { - const loaded = Number(progress && progress.totalBytesSent) || 0 - const currentBytes = Math.min(loaded, end - start) - const percent = ((uploadedBytes + currentBytes) / Math.max(fileInfo.size, 1)) * 100 - onProgress(Math.min(percent, 99.9)) - } - }) - } finally { - await removeFile(chunkPath) - } - - uploadedBytes += (end - start) - onProgress(Math.min((uploadedBytes / Math.max(fileInfo.size, 1)) * 100, 99.9)) - } - - const result = await fileApi.completeChunkUpload(session.uploadId) - onProgress(100) - return result -} - -/** - * Purpose: uploadImageFiles supports upload.js by holding or executing the upload image files page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -async function uploadImageFiles(options) { - const files = normalizeSelectedFiles(options && options.files) - const scene = options && options.scene ? options.scene : 'admin-product-image' - const onProgress = typeof options.onProgress === 'function' ? options.onProgress : () => {} - const results = [] - - for (let index = 0; index < files.length; index += 1) { - const basePercent = (index / Math.max(files.length, 1)) * 100 - const filePercentSize = 100 / Math.max(files.length, 1) - - const result = await uploadSingleFile(files[index], scene, percent => { - onProgress(Math.min(basePercent + (percent / 100) * filePercentSize, 100)) - }) - - results.push(result) - } - - onProgress(100) - return results -} - -/** - * Purpose: chooseImageFiles supports upload.js by holding or executing the choose image files page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function chooseImageFiles(options) { - const config = options || {} - - return new Promise((resolve, reject) => { - wx.chooseMedia({ - count: config.count || 9, - mediaType: ['image'], - sourceType: ['album', 'camera'], - success: result => { - resolve(normalizeSelectedFiles(result.tempFiles || [])) - }, - fail: reject - }) - }) -} - -module.exports = { - chooseImageFiles, - uploadImageFiles -} diff --git a/FD-WeChat-Fronted/assets/tabbar/profile-active.png b/FD-WeChat-Fronted/assets/tabbar/profile-active.png deleted file mode 100644 index bcf33522..00000000 Binary files a/FD-WeChat-Fronted/assets/tabbar/profile-active.png and /dev/null differ diff --git a/FD-WeChat-Fronted/assets/tabbar/profile.png b/FD-WeChat-Fronted/assets/tabbar/profile.png deleted file mode 100644 index b995cb4f..00000000 Binary files a/FD-WeChat-Fronted/assets/tabbar/profile.png and /dev/null differ diff --git a/FD-WeChat-Fronted/components/navigation-bar/navigation-bar.json b/FD-WeChat-Fronted/components/navigation-bar/navigation-bar.json deleted file mode 100644 index 4a20f170..00000000 --- a/FD-WeChat-Fronted/components/navigation-bar/navigation-bar.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "component": true, - "styleIsolation": "apply-shared", - "usingComponents": {} -} \ No newline at end of file diff --git a/FD-WeChat-Fronted/utils/action-guard.js b/FD-WeChat-Fronted/utils/action-guard.js deleted file mode 100644 index 367b9c17..00000000 --- a/FD-WeChat-Fronted/utils/action-guard.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Purpose: inflightScopes supports action-guard.js by holding or executing the inflight scopes page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const inflightScopes = new Map() - -/** - * Purpose: resolveScopeId supports action-guard.js by holding or executing the resolve scope id page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function resolveScopeId(scope) { - if (scope && typeof scope === 'string') { - return scope - } - if (scope && typeof scope.route === 'string' && scope.route) { - return scope.route - } - - const pages = typeof getCurrentPages === 'function' ? getCurrentPages() : [] - const current = pages[pages.length - 1] - if (current && current.route) { - return current.route - } - - return 'global' -} - -/** - * Purpose: getScopeMap supports action-guard.js by holding or executing the get scope map page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function getScopeMap(scopeId) { - if (!inflightScopes.has(scopeId)) { - inflightScopes.set(scopeId, new Map()) - } - return inflightScopes.get(scopeId) -} - -/** - * Purpose: createGuardError supports action-guard.js by holding or executing the create guard error page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function createGuardError(message, scopeId, actionKey) { - const error = new Error(message || '\u64cd\u4f5c\u8fdb\u884c\u4e2d\uff0c\u8bf7\u52ff\u91cd\u590d\u70b9\u51fb') - error.isActionGuardError = true - error.scopeId = scopeId - error.actionKey = actionKey - return error -} - -/** - * Purpose: run supports action-guard.js by holding or executing the run page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -async function run(scope, actionKey, task, options) { - const scopeId = resolveScopeId(scope) - const normalizedKey = String(actionKey || 'default') - const scopeMap = getScopeMap(scopeId) - - if (scopeMap.get(normalizedKey)) { - return Promise.reject(createGuardError((options && options.message) || '', scopeId, normalizedKey)) - } - - scopeMap.set(normalizedKey, true) - try { - return await Promise.resolve().then(() => task()) - } finally { - scopeMap.delete(normalizedKey) - if (!scopeMap.size) { - inflightScopes.delete(scopeId) - } - } -} - -/** - * Purpose: isRunning supports action-guard.js by holding or executing the is running page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function isRunning(scope, actionKey) { - const scopeId = resolveScopeId(scope) - const scopeMap = inflightScopes.get(scopeId) - if (!scopeMap) { - return false - } - return Boolean(scopeMap.get(String(actionKey || 'default'))) -} - -/** - * Purpose: clearScope supports action-guard.js by holding or executing the clear scope page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function clearScope(scope) { - inflightScopes.delete(resolveScopeId(scope)) -} - -/** - * Purpose: isGuardError supports action-guard.js by holding or executing the is guard error page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function isGuardError(error) { - return Boolean(error && error.isActionGuardError) -} - -module.exports = { - run, - isRunning, - clearScope, - isGuardError, - createGuardError -} diff --git a/FD-WeChat-Fronted/utils/crypto.js b/FD-WeChat-Fronted/utils/crypto.js deleted file mode 100644 index 33e0970d..00000000 --- a/FD-WeChat-Fronted/utils/crypto.js +++ /dev/null @@ -1,213 +0,0 @@ -/** - * Purpose: utf8ToBytes supports crypto.js by holding or executing the utf8 to bytes page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function utf8ToBytes(text) { - const encoded = unescape(encodeURIComponent(String(text || ''))) - const bytes = [] - for (let index = 0; index < encoded.length; index += 1) { - bytes.push(encoded.charCodeAt(index)) - } - return bytes -} - -/** - * Purpose: bytesToHex supports crypto.js by holding or executing the bytes to hex page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function bytesToHex(bytes) { - return (Array.isArray(bytes) ? bytes : []).map(item => item.toString(16).padStart(2, '0')).join('') -} - -/** - * Purpose: rightRotate supports crypto.js by holding or executing the right rotate page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function rightRotate(value, amount) { - return (value >>> amount) | (value << (32 - amount)) -} - -/** - * Purpose: sha256Bytes supports crypto.js by holding or executing the sha256 bytes page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function sha256Bytes(messageBytes) { - const k = [ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 - ] - const h = [ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 - ] - const bytes = Array.isArray(messageBytes) ? messageBytes.slice() : [] - const bitLength = BigInt(bytes.length) * 8n - bytes.push(0x80) - while ((bytes.length % 64) !== 56) { - bytes.push(0) - } - for (let index = 7; index >= 0; index -= 1) { - bytes.push(Number((bitLength >> BigInt(index * 8)) & 0xffn)) - } - - const words = new Array(64) - for (let offset = 0; offset < bytes.length; offset += 64) { - for (let index = 0; index < 16; index += 1) { - const start = offset + index * 4 - words[index] = ( - (bytes[start] << 24) | - (bytes[start + 1] << 16) | - (bytes[start + 2] << 8) | - bytes[start + 3] - ) >>> 0 - } - - for (let index = 16; index < 64; index += 1) { - const s0 = (rightRotate(words[index - 15], 7) ^ rightRotate(words[index - 15], 18) ^ (words[index - 15] >>> 3)) >>> 0 - const s1 = (rightRotate(words[index - 2], 17) ^ rightRotate(words[index - 2], 19) ^ (words[index - 2] >>> 10)) >>> 0 - words[index] = (words[index - 16] + s0 + words[index - 7] + s1) >>> 0 - } - - let a = h[0] - let b = h[1] - let c = h[2] - let d = h[3] - let e = h[4] - let f = h[5] - let g = h[6] - let innerH = h[7] - - for (let index = 0; index < 64; index += 1) { - const s1 = (rightRotate(e, 6) ^ rightRotate(e, 11) ^ rightRotate(e, 25)) >>> 0 - const choice = ((e & f) ^ ((~e) & g)) >>> 0 - const temp1 = (innerH + s1 + choice + k[index] + words[index]) >>> 0 - const s0 = (rightRotate(a, 2) ^ rightRotate(a, 13) ^ rightRotate(a, 22)) >>> 0 - const majority = ((a & b) ^ (a & c) ^ (b & c)) >>> 0 - const temp2 = (s0 + majority) >>> 0 - - innerH = g - g = f - f = e - e = (d + temp1) >>> 0 - d = c - c = b - b = a - a = (temp1 + temp2) >>> 0 - } - - h[0] = (h[0] + a) >>> 0 - h[1] = (h[1] + b) >>> 0 - h[2] = (h[2] + c) >>> 0 - h[3] = (h[3] + d) >>> 0 - h[4] = (h[4] + e) >>> 0 - h[5] = (h[5] + f) >>> 0 - h[6] = (h[6] + g) >>> 0 - h[7] = (h[7] + innerH) >>> 0 - } - - const output = [] - h.forEach(value => { - output.push((value >>> 24) & 0xff) - output.push((value >>> 16) & 0xff) - output.push((value >>> 8) & 0xff) - output.push(value & 0xff) - }) - return output -} - -/** - * Purpose: sha256Hex supports crypto.js by holding or executing the sha256 hex page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function sha256Hex(text) { - return bytesToHex(sha256Bytes(utf8ToBytes(text))) -} - -/** - * Purpose: hmacSha256Hex supports crypto.js by holding or executing the hmac sha256 hex page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function hmacSha256Hex(secret, message) { - let keyBytes = utf8ToBytes(secret) - if (keyBytes.length > 64) { - keyBytes = sha256Bytes(keyBytes) - } - while (keyBytes.length < 64) { - keyBytes.push(0) - } - - const outer = [] - const inner = [] - for (let index = 0; index < 64; index += 1) { - outer[index] = keyBytes[index] ^ 0x5c - inner[index] = keyBytes[index] ^ 0x36 - } - - const innerDigest = sha256Bytes(inner.concat(utf8ToBytes(message))) - return bytesToHex(sha256Bytes(outer.concat(innerDigest))) -} - -/** - * Purpose: buildCanonicalParams supports crypto.js by holding or executing the build canonical params page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildCanonicalParams(input) { - const source = input || {} - const keys = Object.keys(source) - .filter(key => source[key] !== undefined && source[key] !== null && source[key] !== '') - .sort() - - return keys.map(key => { - const rawValue = source[key] - const values = Array.isArray(rawValue) ? rawValue.slice() : [rawValue] - const normalized = values - .map(item => String(item)) - .sort() - .join(',') - return `${key}=${normalized}` - }).join('&') -} - -/** - * Purpose: buildJsonPayload supports crypto.js by holding or executing the build json payload page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function buildJsonPayload(data) { - if (data === undefined || data === null || data === '') { - return '' - } - if (typeof data === 'string') { - return data - } - return JSON.stringify(data) -} - -/** - * Purpose: randomNonce supports crypto.js by holding or executing the random nonce page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function randomNonce() { - return `${Date.now()}-${Math.random().toString(36).slice(2, 10)}` -} - -module.exports = { - sha256Hex, - hmacSha256Hex, - buildCanonicalParams, - buildJsonPayload, - randomNonce -} diff --git a/FD-WeChat-Fronted/utils/idle-session.js b/FD-WeChat-Fronted/utils/idle-session.js deleted file mode 100644 index a5adc4bf..00000000 --- a/FD-WeChat-Fronted/utils/idle-session.js +++ /dev/null @@ -1,241 +0,0 @@ -/** - * Purpose: options supports idle-session.js by holding or executing the options page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let options = null -/** - * Purpose: timer supports idle-session.js by holding or executing the timer page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let timer = null -/** - * Purpose: warningShown supports idle-session.js by holding or executing the warning shown page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let warningShown = false -/** - * Purpose: loggingOut supports idle-session.js by holding or executing the logging out page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let loggingOut = false -/** - * Purpose: hiddenAt supports idle-session.js by holding or executing the hidden at page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let hiddenAt = 0 -/** - * Purpose: lastActiveAt supports idle-session.js by holding or executing the last active at page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let lastActiveAt = Date.now() -/** - * Purpose: pagePatched supports idle-session.js by holding or executing the page patched page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let pagePatched = false - -/** - * Purpose: shouldTrackMethod supports idle-session.js by holding or executing the should track method page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function shouldTrackMethod(name) { - return ![ - 'onHide', - 'onUnload', - 'onShareAppMessage', - 'onShareTimeline' - ].includes(name) -} - -/** - * Purpose: ensurePagePatched supports idle-session.js by holding or executing the ensure page patched page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function ensurePagePatched() { - if (pagePatched || typeof Page !== 'function') { - return - } - const originalPage = Page - Page = function wrappedPage(definition) { - const nextDefinition = {} - Object.keys(definition || {}).forEach(key => { - const value = definition[key] - if (typeof value !== 'function') { - nextDefinition[key] = value - return - } - nextDefinition[key] = function wrappedHandler(...args) { - if (shouldTrackMethod(key)) { - markActive() - } - return value.apply(this, args) - } - }) - return originalPage(nextDefinition) - } - pagePatched = true -} - -/** - * Purpose: start supports idle-session.js by holding or executing the start page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function start() { - stop() - if (!options) { - return - } - timer = setInterval(check, 15000) -} - -/** - * Purpose: stop supports idle-session.js by holding or executing the stop page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function stop() { - if (timer) { - clearInterval(timer) - timer = null - } -} - -/** - * Purpose: isLoggedIn supports idle-session.js by holding or executing the is logged in page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function isLoggedIn() { - return options && typeof options.isLoggedIn === 'function' ? Boolean(options.isLoggedIn()) : false -} - -/** - * Purpose: markActive supports idle-session.js by holding or executing the mark active page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function markActive() { - if (!options || !isLoggedIn() || loggingOut) { - return - } - lastActiveAt = Date.now() - warningShown = false -} - -/** - * Purpose: onAppShow supports idle-session.js by holding or executing the on app show page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function onAppShow() { - if (!options) { - return - } - if (hiddenAt > 0 && isLoggedIn()) { - const hiddenDuration = Date.now() - hiddenAt - if (hiddenDuration >= options.timeoutMs) { - forceLogout() - return - } - } - hiddenAt = 0 - markActive() - start() -} - -/** - * Purpose: onAppHide supports idle-session.js by holding or executing the on app hide page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function onAppHide() { - hiddenAt = Date.now() - stop() -} - -/** - * Purpose: check supports idle-session.js by holding or executing the check page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function check() { - if (!options || !isLoggedIn() || loggingOut) { - return - } - const idleMs = Date.now() - lastActiveAt - if (idleMs >= options.timeoutMs) { - forceLogout() - return - } - if (idleMs >= options.timeoutMs - options.warningMs && !warningShown) { - showWarning() - } -} - -/** - * Purpose: showWarning supports idle-session.js by holding or executing the show warning page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function showWarning() { - if (!options || warningShown || loggingOut) { - return - } - warningShown = true - wx.showModal({ - title: options.warningTitle || '登录即将过期', - content: options.warningContent || '长时间未操作,即将退出登录。', - confirmText: options.confirmText || '继续使用', - cancelText: options.cancelText || '退出登录', - success: result => { - warningShown = false - if (result.confirm) { - markActive() - if (typeof options.onContinue === 'function') { - options.onContinue() - } - return - } - forceLogout() - }, - fail: () => { - warningShown = false - } - }) -} - -/** - * Purpose: forceLogout supports idle-session.js by holding or executing the force logout page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function forceLogout() { - if (!options || loggingOut) { - return - } - loggingOut = true - Promise.resolve() - .then(() => (typeof options.onLogout === 'function' ? options.onLogout() : undefined)) - .catch(() => undefined) - .finally(() => { - loggingOut = false - warningShown = false - hiddenAt = 0 - lastActiveAt = Date.now() - }) -} - -/** - * Purpose: init supports idle-session.js by holding or executing the init page or API role. - * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. - */ -function init(nextOptions) { - options = nextOptions || null - lastActiveAt = Date.now() - warningShown = false - loggingOut = false - hiddenAt = 0 - ensurePagePatched() - start() -} - -module.exports = { - init, - start, - stop, - markActive, - onAppShow, - onAppHide -} diff --git a/FD-WeChat-Fronted/utils/session-switch.js b/FD-WeChat-Fronted/utils/session-switch.js deleted file mode 100644 index 62e0ddfa..00000000 --- a/FD-WeChat-Fronted/utils/session-switch.js +++ /dev/null @@ -1,58 +0,0 @@ -const CUSTOMER_HOME_PATH = '/pages/home/index' -const ADMIN_LOGIN_PATH = '/admin/pages/login/index' - -function getCurrentApp() { - return typeof getApp === 'function' ? getApp() : null -} - -function clearCustomerSession() { - const app = getCurrentApp() - if (app && typeof app.clearUserSession === 'function') { - app.clearUserSession() - return - } - try { - wx.removeStorageSync('accessToken') - wx.removeStorageSync('refreshToken') - wx.removeStorageSync('userInfo') - wx.removeStorageSync('needSetPassword') - } catch (error) {} -} - -function clearAdminSession() { - const app = getCurrentApp() - if (app && typeof app.clearAdminSession === 'function') { - app.clearAdminSession() - return - } - try { - wx.removeStorageSync('adminAccessToken') - wx.removeStorageSync('adminRefreshToken') - wx.removeStorageSync('adminUserInfo') - wx.removeStorageSync('adminPermissions') - wx.removeStorageSync('adminCurrentShop') - } catch (error) {} -} - -function relaunch(url) { - wx.reLaunch({ url }) -} - -function openAdminLogin() { - clearCustomerSession() - relaunch(ADMIN_LOGIN_PATH) -} - -function openCustomerHome() { - clearAdminSession() - relaunch(CUSTOMER_HOME_PATH) -} - -module.exports = { - ADMIN_LOGIN_PATH, - CUSTOMER_HOME_PATH, - clearCustomerSession, - clearAdminSession, - openAdminLogin, - openCustomerHome -} diff --git a/FD-WeChat-Fronted/utils/session-switch.test.js b/FD-WeChat-Fronted/utils/session-switch.test.js deleted file mode 100644 index 488de4d3..00000000 --- a/FD-WeChat-Fronted/utils/session-switch.test.js +++ /dev/null @@ -1,43 +0,0 @@ -const assert = require('assert') - -let relaunchedTo = '' -let customerCleared = false -let adminCleared = false - -global.wx = { - reLaunch(options) { - relaunchedTo = options.url - if (typeof options.success === 'function') { - options.success() - } - }, - removeStorageSync() {}, - setStorageSync() {}, - getStorageSync() { - return '' - }, - removeTabBarBadge(options) { - if (options && typeof options.fail === 'function') { - options.fail() - } - } -} - -global.getApp = () => ({ - clearUserSession() { - customerCleared = true - }, - clearAdminSession() { - adminCleared = true - } -}) - -const sessionSwitch = require('./session-switch') - -sessionSwitch.openAdminLogin() -assert.strictEqual(customerCleared, true) -assert.strictEqual(relaunchedTo, '/admin/pages/login/index') - -sessionSwitch.openCustomerHome() -assert.strictEqual(adminCleared, true) -assert.strictEqual(relaunchedTo, '/pages/home/index') diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/controller/admin/AdminWorkbenchController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/controller/admin/AdminWorkbenchController.java deleted file mode 100644 index 431e40a4..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/controller/admin/AdminWorkbenchController.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.analytics.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.analytics.service.WorkbenchService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.analytics.vo.StoreWorkbenchVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; - -@RestController -@RequestMapping("/admin/workbench") -@RequiredArgsConstructor -public class AdminWorkbenchController { - - private final AdminScopeHelper adminScopeHelper; - private final WorkbenchService workbenchService; - - @GetMapping("/summary") - @RequirePermission("workbench:view") - public Result summary(HttpServletRequest request) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - Long artistId = currentUser != null && Integer.valueOf(3).equals(currentUser.getType()) ? currentUser.getId() : null; - return Result.success(workbenchService.getWorkbench(shopId, artistId)); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/controller/admin/AdminArtistScheduleController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/controller/admin/AdminArtistScheduleController.java deleted file mode 100644 index 0b0f1877..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/controller/admin/AdminArtistScheduleController.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.artist.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.ArtistScheduleDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.artist.service.ArtistScheduleService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditActions; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditSupport; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.ArtistScheduleVO; -import lombok.RequiredArgsConstructor; -import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import java.time.LocalDate; -import java.util.List; - -@RestController -@RequestMapping("/admin/artist-schedule") -@RequiredArgsConstructor -public class AdminArtistScheduleController { - - private final ArtistScheduleService artistScheduleService; - private final AdminScopeHelper adminScopeHelper; - private final SecurityAuditSupport securityAuditSupport; - - @PostMapping("/save") - @RequirePermission("schedule:edit") - public Result save(HttpServletRequest request, @RequestBody ArtistScheduleDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - dto.setShopId(adminScopeHelper.resolveShopScope(currentUser, dto.getShopId())); - try { - ArtistScheduleVO result = artistScheduleService.saveSchedule(dto); - securityAuditSupport.success(request, SecurityAuditActions.SCHEDULE_UPDATE, "artistId=" + dto.getArtistId() + ",date=" + dto.getWorkDate()); - return Result.success(result); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.SCHEDULE_UPDATE, "artistId=" + dto.getArtistId() + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @GetMapping("/list") - @RequirePermission("schedule:view") - public Result> list(HttpServletRequest request, - @RequestParam(required = false) Long artistId, - @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate, - @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - return Result.success(artistScheduleService.listSchedules(shopId, artistId, startDate, endDate)); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/controller/admin/AdminNailArtistController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/controller/admin/AdminNailArtistController.java deleted file mode 100644 index 85baa110..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/controller/admin/AdminNailArtistController.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.artist.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.NailArtistInfoDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.artist.service.NailArtistInfoService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@RestController -@RequestMapping("/admin/nail-artist") -@RequiredArgsConstructor -/** - * AdminNailArtistController exposes HTTP endpoints. Start here to learn the request path, parameter names, and which service method is called. - * Beginner guide: follow the call chain Controller -> Service -> ServiceImpl -> Mapper/support class. - */ -public class AdminNailArtistController { - - /** - * Purpose: USER_NOT_FOUND_MESSAGE supports AdminNailArtistController.java by holding or executing the user not found message business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private static final String USER_NOT_FOUND_MESSAGE = "用户信息不存在"; - /** - * Purpose: VIEW_SCOPE_MESSAGE supports AdminNailArtistController.java by holding or executing the view scope message business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private static final String VIEW_SCOPE_MESSAGE = "当前登录店铺无权查看该美甲师,请切换到所属店铺后重试"; - /** - * Purpose: EDIT_SCOPE_MESSAGE supports AdminNailArtistController.java by holding or executing the edit scope message business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private static final String EDIT_SCOPE_MESSAGE = "当前登录店铺无权编辑该美甲师,请切换到所属店铺后重试"; - /** - * Variable `nailArtistInfoService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final NailArtistInfoService nailArtistInfoService; - /** - * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final AdminScopeHelper adminScopeHelper; - - @RequirePermission("nail_artist:view") - @GetMapping("/list") - /** - * Load data by the supplied parameter. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @return Result> result consumed by the caller or returned to the frontend - */ - public Result> getAllNailArtists(HttpServletRequest request) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - if (currentUser == null) { - return Result.error(USER_NOT_FOUND_MESSAGE); - } - - List nailArtistInfoDTOList; - if (Integer.valueOf(4).equals(currentUser.getType())) { - nailArtistInfoDTOList = nailArtistInfoService.getAllNailArtists(); - } else if (Integer.valueOf(2).equals(currentUser.getType())) { - nailArtistInfoDTOList = nailArtistInfoService.getByShopId(currentUser.getShopId()); - } else { - return Result.error("权限不足:缺少权限【查看美甲师】(nail_artist:view)"); - } - - return Result.success(nailArtistInfoDTOList); - } - - @RequirePermission("nail_artist:view") - @GetMapping("/get/{userId}") - /** - * Load data by the supplied parameter. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param userId parameter `userId` supplied by the caller - * @param request parameter `request` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result getNailArtistInfo(@PathVariable Long userId, HttpServletRequest request) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - if (currentUser == null) { - return Result.error(USER_NOT_FOUND_MESSAGE); - } - - if (!Integer.valueOf(4).equals(currentUser.getType())) { - if (Integer.valueOf(2).equals(currentUser.getType())) { - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, userId, VIEW_SCOPE_MESSAGE); - } else if (Integer.valueOf(3).equals(currentUser.getType())) { - if (!currentUser.getId().equals(userId)) { - return Result.error(VIEW_SCOPE_MESSAGE); - } - } else { - return Result.error("权限不足:缺少权限【查看美甲师】(nail_artist:view)"); - } - } - - NailArtistInfoDTO nailArtistInfoDTO = nailArtistInfoService.getByUserId(userId); - return Result.success(nailArtistInfoDTO); - } - - @RequirePermission("nail_artist:edit") - @PostMapping("/save") - @OperationGuard(action = "admin-nail-artist-save", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - /** - * Save submitted data. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param nailArtistInfoDTO parameter `nailArtistInfoDTO` supplied by the caller - * @param request parameter `request` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result saveNailArtistInfo(@RequestBody NailArtistInfoDTO nailArtistInfoDTO, HttpServletRequest request) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - if (currentUser == null) { - return Result.error(USER_NOT_FOUND_MESSAGE); - } - - if (!Integer.valueOf(4).equals(currentUser.getType())) { - if (Integer.valueOf(2).equals(currentUser.getType())) { - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, nailArtistInfoDTO.getUserId(), EDIT_SCOPE_MESSAGE); - } else if (Integer.valueOf(3).equals(currentUser.getType())) { - if (!currentUser.getId().equals(nailArtistInfoDTO.getUserId())) { - return Result.error(EDIT_SCOPE_MESSAGE); - } - } else { - return Result.error("权限不足:缺少权限【编辑美甲师】(nail_artist:edit)"); - } - } - - NailArtistInfoDTO saved = nailArtistInfoService.saveOrUpdateNailArtistInfo(nailArtistInfoDTO); - return Result.success(saved); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/controller/admin/AdminAuthController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/controller/admin/AdminAuthController.java deleted file mode 100644 index 4ea79ab3..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/controller/admin/AdminAuthController.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.auth.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.auth.dto.LoginRequestDTO; -import com.xiaowang.fingertipdesigner.core.modules.planning.dto.PlanningManagerRegisterDTO; -import com.xiaowang.fingertipdesigner.core.modules.auth.dto.RefreshTokenRequestDTO; -import com.xiaowang.fingertipdesigner.core.modules.auth.dto.SwitchShopRequestDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.service.UserService; -import com.xiaowang.fingertipdesigner.core.modules.security.service.SecurityAuditLogService; -import com.xiaowang.fingertipdesigner.core.support.security.RequestThrottleService; -import com.xiaowang.fingertipdesigner.core.support.security.OperationGuardStrategy; -import com.xiaowang.fingertipdesigner.core.utils.AccountValidationUtils; -import com.xiaowang.fingertipdesigner.core.modules.auth.vo.LoginShopSelectionVO; -import com.xiaowang.fingertipdesigner.core.modules.auth.vo.LoginResponseVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import javax.servlet.http.HttpServletRequest; - -@RestController -@RequestMapping("/admin/auth") -@RequiredArgsConstructor -/** - * AdminAuthController exposes HTTP endpoints. Start here to learn the request path, parameter names, and which service method is called. - * Beginner guide: follow the call chain Controller -> Service -> ServiceImpl -> Mapper/support class. - */ -public class AdminAuthController { - /** - * Variable `userService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final UserService userService; - /** - * Variable `requestThrottleService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final RequestThrottleService requestThrottleService; - /** - * Purpose: securityAuditLogService supports AdminAuthController.java by holding or executing the security audit log service business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private final SecurityAuditLogService securityAuditLogService; - - @PostMapping("/login") - @OperationGuard(action = "admin-login", ttlSeconds = 8, message = "登录处理中,请勿重复提交") - /** - * Run the login flow. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param loginRequestDTO parameter `loginRequestDTO` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result login(HttpServletRequest request, @Valid @RequestBody LoginRequestDTO loginRequestDTO) { - requestThrottleService.checkLogin(request, loginRequestDTO.getAccount()); - try { - LoginResponseVO loginResponseVO = userService.adminLogin(loginRequestDTO); - requestThrottleService.clearLoginFailure(request, loginRequestDTO.getAccount()); - securityAuditLogService.record(loginResponseVO.getUserInfo().getId(), loginRequestDTO.getAccount(), "ADMIN_LOGIN", "SUCCESS", null, request); - return Result.success(loginResponseVO); - } catch (RuntimeException exception) { - requestThrottleService.recordLoginFailure(request, loginRequestDTO.getAccount()); - securityAuditLogService.record(null, loginRequestDTO.getAccount(), "ADMIN_LOGIN", "FAIL", exception.getMessage(), request); - throw exception; - } - } - - @PostMapping("/register") - @OperationGuard(action = "admin-planning-register", ttlSeconds = 10, message = "注册处理中,请勿重复提交") - public Result register(@RequestBody PlanningManagerRegisterDTO registerDTO) { - return Result.success(userService.registerPlanningManager(registerDTO)); - } - - @GetMapping("/login-shops/{account}") - /** - * Load data by the supplied parameter. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param account parameter `account` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result getLoginShops(@PathVariable String account) { - return Result.success(userService.getAdminLoginShopSelection(AccountValidationUtils.requireValidAccount(account))); - } - - @PostMapping("/switch-shop") - @OperationGuard(action = "admin-switch-shop", ttlSeconds = 10, message = "门店切换中,请勿重复操作") - /** - * Run business method `switchShop`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param switchShopRequestDTO parameter `switchShopRequestDTO` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result switchShop(HttpServletRequest request, @RequestBody SwitchShopRequestDTO switchShopRequestDTO) { - Long userId = (Long) request.getAttribute("userId"); - return Result.success(userService.switchAdminShop(userId, switchShopRequestDTO.getShopId(), (String) request.getAttribute("sessionId"))); - } - - @PostMapping("/logout") - @OperationGuard(action = "admin-logout", strategy = OperationGuardStrategy.NOOP_IF_DUPLICATE, ttlSeconds = 5) - /** - * Run business method `logout`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result logout(HttpServletRequest request) { - return Result.success(userService.logout((String) request.getAttribute("sessionId"))); - } - - @PostMapping("/refresh") - /** - * Run business method `refreshToken`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param refreshTokenRequestDTO parameter `refreshTokenRequestDTO` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result refreshToken(@RequestBody RefreshTokenRequestDTO refreshTokenRequestDTO) { - LoginResponseVO loginResponseVO = userService.refreshToken(refreshTokenRequestDTO.getRefreshToken()); - if (loginResponseVO.getUserInfo() == null - || loginResponseVO.getUserInfo().getType() == null - || loginResponseVO.getUserInfo().getType() < 2) { - /** - * Run business method `RuntimeException`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @return throw new result consumed by the caller or returned to the frontend - */ - throw new RuntimeException("您没有后台管理权限"); - } - return Result.success(loginResponseVO); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/controller/admin/AdminCommentController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/controller/admin/AdminCommentController.java deleted file mode 100644 index d04d54c6..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/controller/admin/AdminCommentController.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.content.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.content.service.CommentService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.content.vo.CommentVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@RestController -@RequestMapping("/admin/comment") -@RequiredArgsConstructor -/** - * AdminCommentController exposes HTTP endpoints. Start here to learn the request path, parameter names, and which service method is called. - * Beginner guide: follow the call chain Controller -> Service -> ServiceImpl -> Mapper/support class. - */ -public class AdminCommentController { - /** - * Variable `commentService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final CommentService commentService; - /** - * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final AdminScopeHelper adminScopeHelper; - - @GetMapping("/list") - @RequirePermission("comment:view") - public Result> listComments( - HttpServletRequest request, - @RequestParam(required = false) Long productId, - @RequestParam(required = false) Long userId, - @RequestParam(required = false) Long shopId, - @RequestParam(required = false) String keyword - ) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long scopedShopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - return Result.success(commentService.listAdminComments(productId, userId, scopedShopId, keyword)); - } - - @DeleteMapping("/delete/{id}") - @RequirePermission("comment:delete") - /** - * Delete, revoke, or logically remove a record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result deleteComment(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long managedShopId = adminScopeHelper.resolveShopScope(currentUser, null); - return Result.success(commentService.adminDeleteComment(id, managedShopId)); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/controller/admin/AdminInventoryController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/controller/admin/AdminInventoryController.java deleted file mode 100644 index e3ee0a93..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/controller/admin/AdminInventoryController.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.inventory.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.inventory.dto.InventoryAdjustDTO; -import com.xiaowang.fingertipdesigner.core.modules.inventory.dto.InventoryItemDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.inventory.service.InventoryService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditActions; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditSupport; -import com.xiaowang.fingertipdesigner.core.modules.inventory.vo.InventoryItemVO; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; - -@RestController -@RequestMapping("/admin/inventory") -@RequiredArgsConstructor -public class AdminInventoryController { - - private final InventoryService inventoryService; - private final AdminScopeHelper adminScopeHelper; - private final SecurityAuditSupport securityAuditSupport; - - @GetMapping("/list") - @RequirePermission("inventory:view") - public Result> list(HttpServletRequest request, - @RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "10") Integer size) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - return Result.success(inventoryService.listItems(shopId, page, size)); - } - - @PostMapping("/save") - @RequirePermission("inventory:manage") - public Result save(HttpServletRequest request, @RequestBody InventoryItemDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - dto.setShopId(adminScopeHelper.resolveShopScope(currentUser, dto.getShopId())); - return Result.success(inventoryService.saveItem(dto)); - } - - @PostMapping("/{id}/adjust") - @RequirePermission("inventory:manage") - public Result adjust(HttpServletRequest request, @PathVariable Long id, @RequestBody InventoryAdjustDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - try { - InventoryItemVO result = inventoryService.adjustStock(currentUser.getId(), id, dto); - securityAuditSupport.success(request, SecurityAuditActions.INVENTORY_ADJUST, "itemId=" + id); - return Result.success(result); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.INVENTORY_ADJUST, "itemId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/manager/controller/admin/AdminManagerController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/manager/controller/admin/AdminManagerController.java deleted file mode 100644 index 0a376cd9..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/manager/controller/admin/AdminManagerController.java +++ /dev/null @@ -1,297 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.manager.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.ArtistScheduleDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.ArtistScheduleExceptionDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.ArtistScheduleRuleDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.dto.NailArtistInfoDTO; -import com.xiaowang.fingertipdesigner.core.modules.artist.service.ArtistScheduleService; -import com.xiaowang.fingertipdesigner.core.modules.artist.service.NailArtistInfoService; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.ArtistScheduleExceptionVO; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.ArtistScheduleRuleSettingVO; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.ArtistScheduleRuleVO; -import com.xiaowang.fingertipdesigner.core.modules.artist.vo.ArtistScheduleVO; -import com.xiaowang.fingertipdesigner.core.modules.manager.dto.ManagerCustomerCreateDTO; -import com.xiaowang.fingertipdesigner.core.modules.planning.dto.PlanningAppointmentCreateDTO; -import com.xiaowang.fingertipdesigner.core.modules.planning.dto.PlanningAppointmentMoveDTO; -import com.xiaowang.fingertipdesigner.core.modules.planning.dto.PlanningAppointmentStatusDTO; -import com.xiaowang.fingertipdesigner.core.modules.planning.service.PlanningService; -import com.xiaowang.fingertipdesigner.core.modules.planning.vo.PlanningAppointmentVO; -import com.xiaowang.fingertipdesigner.core.modules.planning.vo.PlanningCalendarVO; -import com.xiaowang.fingertipdesigner.core.modules.product.service.ProductService; -import com.xiaowang.fingertipdesigner.core.modules.product.vo.ProductVO; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.shop.dto.ShopDTO; -import com.xiaowang.fingertipdesigner.core.modules.shop.service.ShopService; -import com.xiaowang.fingertipdesigner.core.modules.shop.vo.ShopVO; -import com.xiaowang.fingertipdesigner.core.modules.user.dto.UserDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.user.service.UserService; -import com.xiaowang.fingertipdesigner.core.modules.user.vo.UserVO; -import lombok.RequiredArgsConstructor; -import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.time.LocalDate; -import java.util.List; - -@RestController -@RequestMapping("/admin/manager") -@RequiredArgsConstructor -public class AdminManagerController { - - private final PlanningService planningService; - private final UserService userService; - private final NailArtistInfoService nailArtistInfoService; - private final ArtistScheduleService artistScheduleService; - private final ProductService productService; - private final ShopService shopService; - private final AdminScopeHelper adminScopeHelper; - - @GetMapping("/planning/calendar") - @RequirePermission("schedule:view") - public Result calendar(HttpServletRequest request, - @RequestParam(required = false) String startDate, - @RequestParam(required = false) String endDate, - @RequestParam(required = false) Long artistId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - LocalDate start = startDate == null || startDate.isBlank() ? LocalDate.now() : LocalDate.parse(startDate); - LocalDate end = endDate == null || endDate.isBlank() ? start : LocalDate.parse(endDate); - return Result.success(planningService.getCalendar(currentUser, start, end, artistId)); - } - - @PostMapping("/planning/appointments") - @RequirePermission("order:process") - @OperationGuard(action = "manager-planning-create-appointment", ttlSeconds = 10, message = "预约创建处理中,请勿重复提交") - public Result createAppointment(HttpServletRequest request, - @RequestBody PlanningAppointmentCreateDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(planningService.createAppointment(currentUser, dto)); - } - - @GetMapping("/planning/appointments/{orderItemId}") - @RequirePermission("order:view") - public Result appointment(HttpServletRequest request, - @PathVariable Long orderItemId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(planningService.getAppointment(currentUser, orderItemId)); - } - - @PutMapping("/planning/appointments/{orderItemId}/time-artist") - @RequirePermission("order:process") - @OperationGuard(action = "manager-planning-move-appointment", ttlSeconds = 10, message = "预约调整处理中,请勿重复提交") - public Result moveAppointment(HttpServletRequest request, - @PathVariable Long orderItemId, - @RequestBody PlanningAppointmentMoveDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(planningService.moveAppointment(currentUser, orderItemId, dto)); - } - - @PutMapping("/planning/appointments/{orderId}/status") - @RequirePermission("order:process") - @OperationGuard(action = "manager-planning-update-appointment-status", ttlSeconds = 10, message = "预约状态处理中,请勿重复提交") - public Result updateStatus(HttpServletRequest request, - @PathVariable Long orderId, - @RequestBody PlanningAppointmentStatusDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(planningService.updateStatus(currentUser, orderId, dto)); - } - - @GetMapping("/customers") - @RequirePermission("user:view") - public Result> customers(HttpServletRequest request, - @RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "10") Integer size, - @RequestParam(required = false) String keyword, - @RequestParam(required = false) Long shopId, - @RequestParam(required = false) Boolean hasOrder) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long resolvedShopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - PageResultVO result = userService.pageUsers(page, size, keyword, resolvedShopId, 0, null, null, null, null, null, null, null, null, hasOrder); - return Result.success(result); - } - - @GetMapping("/customers/{id}") - @RequirePermission("user:view") - public Result customer(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, id, "无权查看其他店铺客户"); - return Result.success(userService.getUserById(id)); - } - - @PostMapping("/customers") - @RequirePermission("user:create") - @OperationGuard(action = "manager-customer-create", ttlSeconds = 10, message = "客户创建处理中,请勿重复提交") - public Result createCustomer(HttpServletRequest request, - @Valid @RequestBody ManagerCustomerCreateDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - adminScopeHelper.requireShopContext(currentUser, "请先选择店铺后再新增客户"); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - String phone = dto.getPhone().trim(); - UserDTO userDTO = new UserDTO(); - userDTO.setNickname(dto.getNickname().trim()); - userDTO.setPhone(phone); - userDTO.setContactPhone(phone); - userDTO.setAccount(phone); - userDTO.setType(0); - userDTO.setShopId(shopId); - userDTO.setShopIds(List.of(shopId)); - userDTO.setLevel("普通"); - userDTO.setVipId(0L); - return Result.success(userService.createUser(userDTO)); - } - - @GetMapping("/employees") - @RequirePermission("nail_artist:view") - public Result> employees(HttpServletRequest request) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - if (adminScopeHelper.isPlatformAdmin(currentUser)) { - return Result.success(nailArtistInfoService.getAllNailArtists()); - } - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - return Result.success(nailArtistInfoService.getByShopId(shopId)); - } - - @GetMapping("/employees/{userId}") - @RequirePermission("nail_artist:view") - public Result employee(HttpServletRequest request, @PathVariable Long userId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - if (!adminScopeHelper.isPlatformAdmin(currentUser)) { - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, userId, "无权查看其他店铺员工"); - } - return Result.success(nailArtistInfoService.getByUserId(userId)); - } - - @PostMapping("/employees") - @RequirePermission("nail_artist:edit") - @OperationGuard(action = "manager-nail-artist-save", ttlSeconds = 10, message = "员工信息保存处理中,请勿重复提交") - public Result saveEmployee(HttpServletRequest request, - @RequestBody NailArtistInfoDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - if (!adminScopeHelper.isPlatformAdmin(currentUser)) { - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, dto.getUserId(), "无权编辑其他店铺员工"); - } - return Result.success(nailArtistInfoService.saveOrUpdateNailArtistInfo(dto)); - } - - @PostMapping("/employees/users") - @RequirePermission("user:create") - @OperationGuard(action = "manager-user-create", ttlSeconds = 10, message = "员工账号创建处理中,请勿重复提交") - public Result createEmployeeUser(HttpServletRequest request, - @Valid @RequestBody UserDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - dto.setType(3); - adminScopeHelper.ensureAssignableUserType(currentUser, dto.getType()); - if (!adminScopeHelper.isPlatformAdmin(currentUser)) { - Long managedShopId = adminScopeHelper.getManagedShopId(currentUser); - dto.setShopId(managedShopId); - dto.setShopIds(List.of(managedShopId)); - } - return Result.success(userService.createUser(dto)); - } - - @GetMapping("/employees/schedules") - @RequirePermission("schedule:view") - public Result> schedules(HttpServletRequest request, - @RequestParam(required = false) Long artistId, - @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate, - @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - return Result.success(artistScheduleService.listSchedules(shopId, artistId, startDate, endDate)); - } - - @PostMapping("/employees/schedules") - @RequirePermission("schedule:edit") - @OperationGuard(action = "manager-artist-schedule-save", ttlSeconds = 10, message = "排班保存处理中,请勿重复提交") - public Result saveSchedule(HttpServletRequest request, - @RequestBody ArtistScheduleDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - dto.setShopId(adminScopeHelper.resolveShopScope(currentUser, dto.getShopId())); - return Result.success(artistScheduleService.saveSchedule(dto)); - } - - @GetMapping("/employees/schedule-rule") - @RequirePermission("schedule:view") - public Result scheduleRule(HttpServletRequest request, - @RequestParam Long artistId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - return Result.success(artistScheduleService.getRuleSetting(shopId, artistId)); - } - - @PostMapping("/employees/schedule-rule") - @RequirePermission("schedule:edit") - @OperationGuard(action = "manager-artist-schedule-rule-save", ttlSeconds = 10, message = "排班规则保存处理中,请勿重复提交") - public Result saveScheduleRule(HttpServletRequest request, - @RequestBody ArtistScheduleRuleDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - dto.setShopId(adminScopeHelper.resolveShopScope(currentUser, dto.getShopId())); - return Result.success(artistScheduleService.saveRule(dto)); - } - - @PostMapping("/employees/schedule-exceptions") - @RequirePermission("schedule:edit") - @OperationGuard(action = "manager-artist-schedule-exception-save", ttlSeconds = 10, message = "排班例外保存处理中,请勿重复提交") - public Result saveScheduleException(HttpServletRequest request, - @RequestBody ArtistScheduleExceptionDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - dto.setShopId(adminScopeHelper.resolveShopScope(currentUser, dto.getShopId())); - return Result.success(artistScheduleService.saveException(dto)); - } - - @GetMapping("/products") - @RequirePermission("product:view") - public Result> products(HttpServletRequest request, - @RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "10") Integer size, - @RequestParam(required = false) String keyword, - @RequestParam(required = false) Long shopId, - @RequestParam(required = false) Long tagId, - @RequestParam(required = false) java.math.BigDecimal minPrice, - @RequestParam(required = false) java.math.BigDecimal maxPrice, - @RequestParam(required = false) String createdFrom, - @RequestParam(required = false) String createdTo) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long resolvedShopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - return Result.success(productService.pageProducts(page, size, keyword, resolvedShopId, tagId, minPrice, maxPrice, createdFrom, createdTo)); - } - - @GetMapping("/shop") - @RequirePermission("shop:view") - public Result shop(HttpServletRequest request) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - adminScopeHelper.requireShopContext(currentUser); - return Result.success(shopService.getShopById(shopId)); - } - - @PutMapping("/shop") - @RequirePermission("shop:edit") - @OperationGuard(action = "manager-shop-update", ttlSeconds = 10, message = "店铺设置保存处理中,请勿重复提交") - public Result updateShop(HttpServletRequest request, @RequestBody ShopDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - adminScopeHelper.requireShopContext(currentUser); - ShopVO shop = shopService.getShopById(shopId); - if (shop == null) { - return Result.success(false); - } - if (!adminScopeHelper.isPlatformAdmin(currentUser)) { - dto.setAuthorizationExpireTime(shop.getAuthorizationExpireTime()); - } - return Result.success(shopService.updateShop(shopId, dto)); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/admin/AdminCampaignController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/admin/AdminCampaignController.java deleted file mode 100644 index faab4d07..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/admin/AdminCampaignController.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.marketing.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.marketing.dto.CampaignDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.marketing.service.CampaignService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditActions; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditSupport; -import com.xiaowang.fingertipdesigner.core.modules.marketing.vo.CampaignVO; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; - -@RestController -@RequestMapping("/admin/campaign") -@RequiredArgsConstructor -public class AdminCampaignController { - - private final CampaignService campaignService; - private final AdminScopeHelper adminScopeHelper; - private final SecurityAuditSupport securityAuditSupport; - - @GetMapping("/list") - @RequirePermission("campaign:view") - public Result> list(HttpServletRequest request, - @RequestParam(required = false) Integer status, - @RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "10") Integer size) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - return Result.success(campaignService.listCampaigns(shopId, status, page, size)); - } - - @PostMapping("/save") - @RequirePermission("campaign:manage") - public Result save(HttpServletRequest request, @RequestBody CampaignDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - dto.setShopId(adminScopeHelper.resolveShopScope(currentUser, dto.getShopId())); - try { - CampaignVO result = campaignService.saveCampaign(dto); - securityAuditSupport.success(request, SecurityAuditActions.CAMPAIGN_PUBLISH, "campaignId=" + result.getId()); - return Result.success(result); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.CAMPAIGN_PUBLISH, "reason=" + exception.getMessage()); - throw exception; - } - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/admin/AdminCouponController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/admin/AdminCouponController.java deleted file mode 100644 index 21fe8fbe..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/admin/AdminCouponController.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.marketing.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.marketing.dto.CouponDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.marketing.service.CouponService; -import com.xiaowang.fingertipdesigner.core.modules.user.service.UserService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.marketing.vo.CouponVO; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import com.xiaowang.fingertipdesigner.core.modules.user.vo.UserVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 后台优惠券管理控制器 - */ -@RestController -@RequestMapping("/admin/coupon") -@RequiredArgsConstructor -public class AdminCouponController { - /** - * Variable `couponService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final CouponService couponService; - /** - * Variable `userService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final UserService userService; - /** - * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final AdminScopeHelper adminScopeHelper; - - /** - * 创建优惠券 - */ - @PostMapping("/create") - @RequirePermission("coupon:create") - @OperationGuard(action = "admin-coupon-create", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - public Result createCoupon(HttpServletRequest request, @RequestBody CouponDTO couponDTO, @RequestParam(required = false) Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - shopId = adminScopeHelper.resolveShopScope(currentUser, shopId != null ? shopId : couponDTO.getShopId()); - Long couponId = couponService.createCoupon(couponDTO, shopId); - return Result.success(couponId); - } - - /** - * 更新优惠券 - */ - @PutMapping("/update/{id}") - @RequirePermission("coupon:edit") - @OperationGuard(action = "admin-coupon-update", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - public Result updateCoupon(HttpServletRequest request, @PathVariable Long id, @RequestBody CouponDTO couponDTO, @RequestParam(required = false) Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - CouponVO couponVO = couponService.getCouponById(id); - if (couponVO == null) { - return Result.success(false); - } - adminScopeHelper.ensureShopAccessible(currentUser, couponVO.getShopId(), "无权编辑其他店铺优惠券"); - Long targetShopId = shopId != null ? shopId : (couponDTO.getShopId() != null ? couponDTO.getShopId() : couponVO.getShopId()); - shopId = adminScopeHelper.resolveShopScope(currentUser, targetShopId); - boolean success = couponService.updateCoupon(id, couponDTO, shopId); - return Result.success(success); - } - - /** - * 删除优惠券 - */ - @DeleteMapping("/delete/{id}") - @RequirePermission("coupon:delete") - @OperationGuard(action = "admin-coupon-delete", ttlSeconds = 10, message = "操作处理中,请勿重复提交") - public Result deleteCoupon(HttpServletRequest request, @PathVariable Long id, @RequestParam(required = false) Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - CouponVO couponVO = couponService.getCouponById(id); - if (couponVO == null) { - return Result.success(false); - } - adminScopeHelper.ensureShopAccessible(currentUser, couponVO.getShopId(), "无权删除其他店铺优惠券"); - shopId = adminScopeHelper.resolveShopScope(currentUser, couponVO.getShopId()); - boolean success = couponService.deleteCoupon(id, shopId); - return Result.success(success); - } - - /** - * 获取优惠券详情 - */ - @GetMapping("/detail/{id}") - @RequirePermission("coupon:view") - public Result getCouponById(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - CouponVO couponVO = couponService.getCouponById(id); - if (couponVO != null) { - adminScopeHelper.ensureShopAccessible(currentUser, couponVO.getShopId(), "无权查看其他店铺优惠券"); - } - return Result.success(couponVO); - } - - /** - * 获取优惠券列表 - */ - @GetMapping("/list") - @RequirePermission("coupon:view") - public Result> listCoupons(HttpServletRequest request, @RequestParam Integer page, @RequestParam Integer size, @RequestParam(required = false) Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - shopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - PageResultVO pageResult = couponService.listCoupons(page, size, shopId); - return Result.success(pageResult); - } - - /** - * 获取所有优惠券 - */ - @GetMapping("/list/all") - @RequirePermission("coupon:view") - public Result> listAllCoupons(HttpServletRequest request, @RequestParam(required = false) Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - shopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - List coupons = couponService.listAllCoupons(); - Long resolvedShopId = shopId; - if (resolvedShopId != null) { - coupons = coupons.stream() - .filter(coupon -> resolvedShopId.equals(coupon.getShopId())) - .collect(Collectors.toList()); - } - return Result.success(coupons); - } - - /** - * 为用户分配优惠券 - */ - @PostMapping("/assign") - @RequirePermission("coupon:assign") - @OperationGuard(action = "admin-coupon-assign", ttlSeconds = 15, message = "操作处理中,请勿重复提交") - public Result assignCouponToUser(HttpServletRequest request, @RequestParam Long userId, @RequestParam Long couponId, @RequestParam(required = false) Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - CouponVO couponVO = couponService.getCouponById(couponId); - if (couponVO == null) { - return Result.success(false); - } - adminScopeHelper.ensureShopAccessible(currentUser, couponVO.getShopId(), "无权发放其他店铺优惠券"); - UserVO targetUser = userService.getUserById(userId); - if (targetUser == null) { - return Result.success(false); - } - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, userId, "无权给其他店铺用户发放优惠券"); - shopId = adminScopeHelper.resolveShopScope(currentUser, couponVO.getShopId()); - boolean success = couponService.assignCouponToUser(userId, couponId, shopId); - return Result.success(success); - } - - /** - * 发放优惠券 - */ - @PostMapping("/distribute") - @RequirePermission("coupon:assign") - @OperationGuard(action = "admin-coupon-distribute", ttlSeconds = 15, message = "操作处理中,请勿重复提交") - public Result distributeCoupon(HttpServletRequest request, @RequestParam Long couponId, @RequestParam List userIds, @RequestParam Integer quantity, @RequestParam(required = false) Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - CouponVO couponVO = couponService.getCouponById(couponId); - if (couponVO == null) { - return Result.success(false); - } - adminScopeHelper.ensureShopAccessible(currentUser, couponVO.getShopId(), "无权发放其他店铺优惠券"); - for (Long userId : userIds) { - UserVO targetUser = userService.getUserById(userId); - if (targetUser == null) { - return Result.success(false); - } - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, userId, "无权给其他店铺用户发放优惠券"); - } - shopId = adminScopeHelper.resolveShopScope(currentUser, couponVO.getShopId()); - boolean success = couponService.distributeCoupon(couponId, userIds, quantity, shopId); - return Result.success(success); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/admin/AdminAfterSaleController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/admin/AdminAfterSaleController.java deleted file mode 100644 index d1ce55ef..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/admin/AdminAfterSaleController.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.order.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.order.dto.AfterSaleAuditDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.order.service.AfterSaleService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditActions; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditSupport; -import com.xiaowang.fingertipdesigner.core.modules.order.vo.AfterSaleVO; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; - -@RestController -@RequestMapping("/admin/after-sale") -@RequiredArgsConstructor -public class AdminAfterSaleController { - - private final AfterSaleService afterSaleService; - private final AdminScopeHelper adminScopeHelper; - private final SecurityAuditSupport securityAuditSupport; - - @GetMapping("/list") - @RequirePermission("after_sale:view") - public Result> list(HttpServletRequest request, - @RequestParam(required = false) String status, - @RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "10") Integer size) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - return Result.success(afterSaleService.listAdmin(shopId, status, page, size)); - } - - @PutMapping("/{id}/approve") - @RequirePermission("after_sale:audit") - public Result approve(HttpServletRequest request, @PathVariable Long id, @RequestBody(required = false) AfterSaleAuditDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - try { - AfterSaleVO result = afterSaleService.approve(currentUser.getId(), id, dto); - securityAuditSupport.success(request, SecurityAuditActions.AFTER_SALE_APPROVE, "afterSaleId=" + id); - return Result.success(result); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.AFTER_SALE_APPROVE, "afterSaleId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @PutMapping("/{id}/reject") - @RequirePermission("after_sale:audit") - public Result reject(HttpServletRequest request, @PathVariable Long id, @RequestBody(required = false) AfterSaleAuditDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - try { - AfterSaleVO result = afterSaleService.reject(currentUser.getId(), id, dto); - securityAuditSupport.success(request, SecurityAuditActions.AFTER_SALE_REJECT, "afterSaleId=" + id); - return Result.success(result); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.AFTER_SALE_REJECT, "afterSaleId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/admin/AdminOrderController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/admin/AdminOrderController.java deleted file mode 100644 index 40644182..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/admin/AdminOrderController.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.order.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.order.dto.OrderQuoteSubmitDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.order.service.OrderService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.order.vo.OrderVO; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * 后台订单管理控制器 - */ -@RestController -@RequestMapping("/admin/order") -@RequiredArgsConstructor -public class AdminOrderController { - /** - * Variable `orderService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final OrderService orderService; - /** - * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final AdminScopeHelper adminScopeHelper; - - /** - * 获取订单列表(分页) - */ - @GetMapping("/list") - @RequirePermission("order:view") - public Result> listOrders( - HttpServletRequest request, - @RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "10") Integer size, - @RequestParam(required = false) String keyword, - @RequestParam(required = false) Long shopId, - @RequestParam(required = false) Integer status - ) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long scopedShopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - - List allOrders; - if (Integer.valueOf(3).equals(currentUser.getType())) { - allOrders = orderService.getOrdersByArtistId(currentUser.getId()); - } else { - allOrders = orderService.getAllOrders(); - } - if (scopedShopId != null && !Integer.valueOf(3).equals(currentUser.getType())) { - allOrders = allOrders.stream() - .filter(order -> scopedShopId.equals(order.getShopId())) - .toList(); - } - - if (keyword != null && !keyword.isEmpty()) { - allOrders = allOrders.stream() - .filter(order -> order.getOrderNo() != null && order.getOrderNo().contains(keyword)) - .toList(); - } - if (status != null) { - allOrders = allOrders.stream() - .filter(order -> order.getStatus() == status) - .toList(); - } - - int total = allOrders.size(); - int start = (page - 1) * size; - int end = Math.min(start + size, total); - List pageList = start < total ? allOrders.subList(start, end) : List.of(); - - PageResultVO result = new PageResultVO<>(); - result.setList(pageList); - result.setTotal((long) total); - result.setPage(page); - result.setSize(size); - - return Result.success(result); - } - - @GetMapping("/detail/{id}") - @RequirePermission("order:view") - /** - * Purpose: getOrderDetail supports AdminOrderController.java by holding or executing the get order detail business role. - * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. - */ - public Result getOrderDetail(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - List allOrders; - if (Integer.valueOf(3).equals(currentUser.getType())) { - allOrders = orderService.getOrdersByArtistId(currentUser.getId()); - } else { - allOrders = orderService.getAllOrders(); - } - OrderVO orderVO = allOrders.stream() - .filter(order -> id.equals(order.getId())) - .findFirst() - .orElseThrow(() -> new RuntimeException("订单不存在")); - if (!Integer.valueOf(3).equals(currentUser.getType())) { - adminScopeHelper.ensureShopAccessible(currentUser, orderVO.getShopId(), "无权查看其他店铺订单"); - } - return Result.success(orderVO); - } - - /** - * 更新订单状态 - */ - @PutMapping("/update-status/{id}") - @RequirePermission("order:process") - @OperationGuard(action = "admin-order-update-status", ttlSeconds = 15, message = "操作处理中,请勿重复提交") - public Result updateOrderStatus(HttpServletRequest request, @PathVariable Long id, @RequestParam Integer status) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - if (Integer.valueOf(3).equals(currentUser.getType())) { - if (!Integer.valueOf(2).equals(status)) { - /** - * Run business method `RuntimeException`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @return throw new result consumed by the caller or returned to the frontend - */ - throw new RuntimeException("美甲师只能完成属于自己的订单"); - } - orderService.completeArtistOrder(id, currentUser.getId()); - return Result.success(true); - } - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - if (shopId != null) { - OrderVO orderVO = orderService.getAllOrders().stream() - .filter(order -> id.equals(order.getId())) - .findFirst() - .orElse(null); - if (orderVO == null) { - return Result.success(false); - } - adminScopeHelper.ensureShopAccessible(currentUser, orderVO.getShopId(), "无权处理其他店铺订单"); - } - orderService.processOrder(id, status); - return Result.success(true); - } - - @PostMapping("/{id}/quote") - @RequirePermission("order:process") - @OperationGuard(action = "admin-order-quote-submit", ttlSeconds = 10, message = "报价处理中,请勿重复提交") - public Result submitQuote(HttpServletRequest request, - @PathVariable Long id, - @RequestBody OrderQuoteSubmitDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(orderService.submitShopQuote(id, currentUser.getId(), currentUser.getType(), dto)); - } - - @PutMapping("/{id}/quote/confirm") - @RequirePermission("order:process") - @OperationGuard(action = "admin-order-quote-confirm", ttlSeconds = 10, message = "确认处理中,请勿重复提交") - public Result confirmQuote(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(orderService.confirmShopQuote(id, currentUser.getId(), currentUser.getType())); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/admin/AdminPaymentController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/admin/AdminPaymentController.java deleted file mode 100644 index ced1f886..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/admin/AdminPaymentController.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.payment.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.payment.service.PaymentService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditActions; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditSupport; -import com.xiaowang.fingertipdesigner.core.modules.payment.vo.PaymentOrderVO; -import com.xiaowang.fingertipdesigner.core.modules.payment.vo.RefundOrderVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; - -@RestController -@RequestMapping("/admin/payment") -@RequiredArgsConstructor -public class AdminPaymentController { - - private final PaymentService paymentService; - private final AdminScopeHelper adminScopeHelper; - private final SecurityAuditSupport securityAuditSupport; - - @PostMapping("/order/{orderId}/manual-confirm") - @RequirePermission("payment:manage") - public Result manualConfirm(HttpServletRequest request, - @PathVariable Long orderId, - @RequestParam(required = false) String remark) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - try { - PaymentOrderVO result = paymentService.manualConfirmOrderPaid(currentUser.getId(), orderId, remark); - securityAuditSupport.success(request, SecurityAuditActions.PAYMENT_MANUAL_CONFIRM, "orderId=" + orderId); - return Result.success(result); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.PAYMENT_MANUAL_CONFIRM, "orderId=" + orderId + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @PostMapping("/order/{orderId}/manual-refund") - @RequirePermission("refund:manage") - public Result manualRefund(HttpServletRequest request, - @PathVariable Long orderId, - @RequestParam(required = false) Long afterSaleId, - @RequestParam(required = false) String remark) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - try { - RefundOrderVO result = paymentService.manualRefundOrder(currentUser.getId(), orderId, afterSaleId, remark); - securityAuditSupport.success(request, SecurityAuditActions.REFUND_MANUAL_CONFIRM, "orderId=" + orderId); - return Result.success(result); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.REFUND_MANUAL_CONFIRM, "orderId=" + orderId + ",reason=" + exception.getMessage()); - throw exception; - } - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/controller/admin/AdminPlanningController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/controller/admin/AdminPlanningController.java deleted file mode 100644 index b4b7ce36..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/controller/admin/AdminPlanningController.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.planning.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.planning.dto.PlanningAppointmentCreateDTO; -import com.xiaowang.fingertipdesigner.core.modules.planning.dto.PlanningAppointmentMoveDTO; -import com.xiaowang.fingertipdesigner.core.modules.planning.dto.PlanningAppointmentStatusDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.planning.service.PlanningService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.planning.vo.PlanningAppointmentVO; -import com.xiaowang.fingertipdesigner.core.modules.planning.vo.PlanningCalendarVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import java.time.LocalDate; - -@RestController -@RequestMapping("/admin/planning") -@RequiredArgsConstructor -public class AdminPlanningController { - - private final PlanningService planningService; - private final AdminScopeHelper adminScopeHelper; - - @GetMapping("/calendar") - @RequirePermission("schedule:view") - public Result calendar(HttpServletRequest request, - @RequestParam(required = false) String startDate, - @RequestParam(required = false) String endDate, - @RequestParam(required = false) Long artistId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - LocalDate start = startDate == null || startDate.isBlank() ? LocalDate.now() : LocalDate.parse(startDate); - LocalDate end = endDate == null || endDate.isBlank() ? start : LocalDate.parse(endDate); - return Result.success(planningService.getCalendar(currentUser, start, end, artistId)); - } - - @PostMapping("/appointments") - @RequirePermission("order:process") - @OperationGuard(action = "admin-planning-create-appointment", ttlSeconds = 10, message = "预约创建处理中,请勿重复提交") - public Result createAppointment(HttpServletRequest request, - @RequestBody PlanningAppointmentCreateDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(planningService.createAppointment(currentUser, dto)); - } - - @GetMapping("/appointments/{orderItemId}") - @RequirePermission("order:view") - public Result appointment(HttpServletRequest request, - @PathVariable Long orderItemId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(planningService.getAppointment(currentUser, orderItemId)); - } - - @PutMapping("/appointments/{orderItemId}/time-artist") - @RequirePermission("order:process") - @OperationGuard(action = "admin-planning-move-appointment", ttlSeconds = 10, message = "预约调整处理中,请勿重复提交") - public Result moveAppointment(HttpServletRequest request, - @PathVariable Long orderItemId, - @RequestBody PlanningAppointmentMoveDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(planningService.moveAppointment(currentUser, orderItemId, dto)); - } - - @PutMapping("/appointments/{orderId}/status") - @RequirePermission("order:process") - @OperationGuard(action = "admin-planning-update-appointment-status", ttlSeconds = 10, message = "预约状态处理中,请勿重复提交") - public Result updateStatus(HttpServletRequest request, - @PathVariable Long orderId, - @RequestBody PlanningAppointmentStatusDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(planningService.updateStatus(currentUser, orderId, dto)); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/admin/AdminProductController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/admin/AdminProductController.java deleted file mode 100644 index 2c3e5a1a..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/admin/AdminProductController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.product.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.product.dto.ProductDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.product.service.ProductService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import com.xiaowang.fingertipdesigner.core.modules.product.vo.ProductVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@RestController -@RequestMapping("/admin/product") -@RequiredArgsConstructor -/** - * AdminProductController exposes HTTP endpoints. Start here to learn the request path, parameter names, and which service method is called. - * Beginner guide: follow the call chain Controller -> Service -> ServiceImpl -> Mapper/support class. - */ -public class AdminProductController { - /** - * Variable `productService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final ProductService productService; - /** - * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final AdminScopeHelper adminScopeHelper; - - @GetMapping("/list") - @RequirePermission("product:view") - public Result> listProducts( - HttpServletRequest request, - @RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "10") Integer size, - @RequestParam(required = false) String keyword, - @RequestParam(required = false) Long shopId, - @RequestParam(required = false) Long tagId, - @RequestParam(required = false) java.math.BigDecimal minPrice, - @RequestParam(required = false) java.math.BigDecimal maxPrice, - @RequestParam(required = false) String createdFrom, - @RequestParam(required = false) String createdTo - ) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - shopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - PageResultVO result = productService.pageProducts(page, size, keyword, shopId, tagId, minPrice, maxPrice, createdFrom, createdTo); - return Result.success(result); - } - - @PostMapping("/create") - @RequirePermission("product:create") - @OperationGuard(action = "admin-product-create", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - /** - * Create a new record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param productDTO parameter `productDTO` supplied by the caller yu - * @return Result result consumed by the caller or returned to the frontend - */ - public Result createProduct(HttpServletRequest request, @RequestBody ProductDTO productDTO) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - productDTO.setShopId(adminScopeHelper.resolveShopScope(currentUser, productDTO.getShopId())); - Long id = productService.createProduct(productDTO); - return Result.success(id); - } - - @PutMapping("/update/{id}") - @RequirePermission("product:edit") - @OperationGuard(action = "admin-product-update", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - /** - * Update an existing record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @param productDTO parameter `productDTO` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result updateProduct(HttpServletRequest request, @PathVariable Long id, @RequestBody ProductDTO productDTO) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - ProductVO productVO = productService.getProductById(id); - if (productVO == null) { - return Result.success(false); - } - adminScopeHelper.ensureShopAccessible(currentUser, productVO.getShopId(), "无权编辑其他店铺商品"); - Long targetShopId = productDTO.getShopId() != null ? productDTO.getShopId() : productVO.getShopId(); - productDTO.setShopId(adminScopeHelper.resolveShopScope(currentUser, targetShopId)); - boolean success = productService.updateProduct(id, productDTO); - return Result.success(success); - } - - @DeleteMapping("/delete/{id}") - @RequirePermission("product:delete") - @OperationGuard(action = "admin-product-delete", ttlSeconds = 10, message = "操作处理中,请勿重复提交") - /** - * Delete, revoke, or logically remove a record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result deleteProduct(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - ProductVO productVO = productService.getProductById(id); - if (productVO == null) { - return Result.success(false); - } - adminScopeHelper.ensureShopAccessible(currentUser, productVO.getShopId(), "无权删除其他店铺商品"); - boolean success = productService.deleteProduct(id); - return Result.success(success); - } - - @GetMapping("/list/all") - @RequirePermission("product:view") - /** - * List records for the current query or current user scope. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @return Result> result consumed by the caller or returned to the frontend - */ - public Result> listAllProducts(HttpServletRequest request) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - List products = shopId == null - ? productService.listAllProducts() - : productService.listProductsByShopId(shopId); - return Result.success(products); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/admin/AdminTagController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/admin/AdminTagController.java deleted file mode 100644 index e6c65bcc..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/admin/AdminTagController.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.product.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.product.dto.TagDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.product.service.TagService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.product.vo.TagVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * 后台标签管理控制器 - */ -@RestController -@RequestMapping("/admin/tag") -@RequiredArgsConstructor -public class AdminTagController { - /** - * Variable `tagService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final TagService tagService; - /** - * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final AdminScopeHelper adminScopeHelper; - - /** - * 创建标签 - */ - @PostMapping("/create") - @RequirePermission("tag:create") - @OperationGuard(action = "admin-tag-create", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - public Result createTag(HttpServletRequest request, @RequestBody TagDTO tagDTO) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - tagDTO.setShopId(adminScopeHelper.resolveShopScope(currentUser, tagDTO.getShopId())); - Long id = tagService.createTag(tagDTO); - return Result.success(id); - } - - /** - * 更新标签 - */ - @PutMapping("/update/{id}") - @RequirePermission("tag:edit") - @OperationGuard(action = "admin-tag-update", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - public Result updateTag(HttpServletRequest request, @PathVariable Long id, @RequestBody TagDTO tagDTO) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - TagVO tagVO = tagService.getTagById(id); - if (tagVO == null) { - return Result.success(false); - } - adminScopeHelper.ensureShopAccessible(currentUser, tagVO.getShopId(), "无权编辑其他店铺标签"); - Long targetShopId = tagDTO.getShopId() != null ? tagDTO.getShopId() : tagVO.getShopId(); - tagDTO.setShopId(adminScopeHelper.resolveShopScope(currentUser, targetShopId)); - boolean success = tagService.updateTag(id, tagDTO); - return Result.success(success); - } - - /** - * 删除标签 - */ - @DeleteMapping("/delete/{id}") - @RequirePermission("tag:delete") - @OperationGuard(action = "admin-tag-delete", ttlSeconds = 10, message = "操作处理中,请勿重复提交") - public Result deleteTag(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - TagVO tagVO = tagService.getTagById(id); - if (tagVO == null) { - return Result.success(false); - } - adminScopeHelper.ensureShopAccessible(currentUser, tagVO.getShopId(), "无权删除其他店铺标签"); - boolean success = tagService.deleteTag(id); - return Result.success(success); - } - - /** - * 根据ID查询标签 - */ - @GetMapping("/get/{id}") - @RequirePermission("tag:view") - public Result getTagById(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - TagVO tagVO = tagService.getTagById(id); - if (tagVO != null) { - adminScopeHelper.ensureShopAccessible(currentUser, tagVO.getShopId(), "无权查看其他店铺标签"); - } - return Result.success(tagVO); - } - - /** - * 查询所有标签 - */ - @GetMapping("/list/all") - @RequirePermission("tag:view") - public Result> listAllTags(HttpServletRequest request) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long shopId = adminScopeHelper.resolveShopScope(currentUser, null); - List tagVOs = shopId == null ? tagService.listAllTags() : tagService.listTagsByShopId(shopId); - return Result.success(tagVOs); - } - - /** - * 根据店铺ID查询标签 - */ - @GetMapping("/list/by-shop/{shopId}") - @RequirePermission("tag:view") - public Result> listTagsByShopId(HttpServletRequest request, @PathVariable Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - shopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - List tagVOs = tagService.listTagsByShopId(shopId); - return Result.success(tagVOs); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminPermissionController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminPermissionController.java deleted file mode 100644 index d7d0cebd..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminPermissionController.java +++ /dev/null @@ -1,236 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.security.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.security.dto.PermissionDTO; -import com.xiaowang.fingertipdesigner.core.modules.security.dto.UserPermissionDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.security.service.PermissionService; -import com.xiaowang.fingertipdesigner.core.modules.user.service.UserService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditActions; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditSupport; -import com.xiaowang.fingertipdesigner.core.modules.security.vo.PermissionVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@RestController -@RequestMapping("/admin/permission") -@RequiredArgsConstructor -/** - * AdminPermissionController exposes HTTP endpoints. Start here to learn the request path, parameter names, and which service method is called. - * Beginner guide: follow the call chain Controller -> Service -> ServiceImpl -> Mapper/support class. - */ -public class AdminPermissionController { - /** - * Variable `permissionService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final PermissionService permissionService; - /** - * Variable `userService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final UserService userService; - /** - * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final AdminScopeHelper adminScopeHelper; - /** - * Purpose: securityAuditSupport supports AdminPermissionController.java by holding or executing the security audit support business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private final SecurityAuditSupport securityAuditSupport; - - @PostMapping("/create") - @RequirePermission("permission:create") - @OperationGuard(action = "admin-permission-create", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - /** - * Create a new record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param permissionDTO parameter `permissionDTO` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result createPermission(HttpServletRequest request, @RequestBody PermissionDTO permissionDTO) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - adminScopeHelper.requirePlatformAdmin(currentUser, "只有平台管理员可以维护权限定义"); - try { - Long id = permissionService.createPermission(permissionDTO); - securityAuditSupport.success(request, SecurityAuditActions.PERMISSION_CREATE, "permissionId=" + id); - return Result.success(id); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.PERMISSION_CREATE, "reason=" + exception.getMessage()); - throw exception; - } - } - - @PutMapping("/update/{id}") - @RequirePermission("permission:edit") - @OperationGuard(action = "admin-permission-update", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - /** - * Update an existing record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @param permissionDTO parameter `permissionDTO` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result updatePermission(HttpServletRequest request, @PathVariable Long id, @RequestBody PermissionDTO permissionDTO) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - adminScopeHelper.requirePlatformAdmin(currentUser, "只有平台管理员可以维护权限定义"); - try { - boolean success = permissionService.updatePermission(id, permissionDTO); - securityAuditSupport.success(request, SecurityAuditActions.PERMISSION_UPDATE, "permissionId=" + id + ",result=" + success); - return Result.success(success); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.PERMISSION_UPDATE, "permissionId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @DeleteMapping("/delete/{id}") - @RequirePermission("permission:delete") - @OperationGuard(action = "admin-permission-delete", ttlSeconds = 10, message = "操作处理中,请勿重复提交") - /** - * Delete, revoke, or logically remove a record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result deletePermission(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - adminScopeHelper.requirePlatformAdmin(currentUser, "只有平台管理员可以维护权限定义"); - try { - boolean success = permissionService.deletePermission(id); - securityAuditSupport.success(request, SecurityAuditActions.PERMISSION_DELETE, "permissionId=" + id + ",result=" + success); - return Result.success(success); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.PERMISSION_DELETE, "permissionId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @GetMapping("/get/{id}") - @RequirePermission("permission:view") - /** - * Load data by the supplied parameter. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param id parameter `id` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result getPermissionById(@PathVariable Long id) { - PermissionVO permissionVO = permissionService.getPermissionById(id); - return Result.success(permissionVO); - } - - @GetMapping("/list/all") - @RequirePermission("permission:view") - /** - * List records for the current query or current user scope. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @return Result> result consumed by the caller or returned to the frontend - */ - public Result> listAllPermissions() { - List permissionVOs = permissionService.listAllPermissions(); - return Result.success(permissionVOs); - } - - @GetMapping("/list/group/{permissionGroup}") - @RequirePermission("permission:view") - /** - * List records for the current query or current user scope. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param permissionGroup parameter `permissionGroup` supplied by the caller - * @return Result> result consumed by the caller or returned to the frontend - */ - public Result> listPermissionsByGroup(@PathVariable String permissionGroup) { - List permissionVOs = permissionService.listPermissionsByGroup(permissionGroup); - return Result.success(permissionVOs); - } - - @GetMapping("/user/{userId}") - @RequirePermission("permission:view") - /** - * List records for the current query or current user scope. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param userId parameter `userId` supplied by the caller - * @return Result> result consumed by the caller or returned to the frontend - */ - public Result> listUserPermissions(HttpServletRequest request, @PathVariable Long userId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - if (!adminScopeHelper.isPlatformAdmin(currentUser)) { - UserDO targetUser = userService.getById(userId); - if (targetUser == null) { - /** - * Run business method `RuntimeException`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @return throw new result consumed by the caller or returned to the frontend - */ - throw new RuntimeException("目标用户不存在"); - } - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, userId, "无权查看其他店铺用户权限"); - } - List permissionVOs = permissionService.listUserPermissions(userId); - return Result.success(permissionVOs); - } - - @GetMapping("/assignable/{userId}") - @RequirePermission("permission:assign") - /** - * List records for the current query or current user scope. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param userId parameter `userId` supplied by the caller - * @return Result> result consumed by the caller or returned to the frontend - */ - public Result> listAssignablePermissionIds(HttpServletRequest request, @PathVariable Long userId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - if (!adminScopeHelper.isPlatformAdmin(currentUser)) { - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, userId, "无权给其他店铺用户分配权限"); - } - Long currentUserId = (Long) request.getAttribute("userId"); - return Result.success(permissionService.listAssignablePermissionIds(userId, currentUserId)); - } - - @GetMapping("/user/current") - /** - * Load data by the supplied parameter. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @return Result> result consumed by the caller or returned to the frontend - */ - public Result> getCurrentUserPermissions(HttpServletRequest request) { - Long userId = (Long) request.getAttribute("userId"); - userService.syncManagedPermissions(userId); - List permissions = permissionService.listUserPermissions(userId); - return Result.success(permissions); - } - - @PostMapping("/assign/{userId}") - @RequirePermission("permission:assign") - @OperationGuard(action = "admin-permission-assign", ttlSeconds = 15, message = "操作处理中,请勿重复提交") - public Result assignPermissions( - HttpServletRequest request, - @PathVariable Long userId, - @RequestBody UserPermissionDTO userPermissionDTO) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - if (!adminScopeHelper.isPlatformAdmin(currentUser)) { - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, userId, "无权给其他店铺用户分配权限"); - } - Long currentUserId = (Long) request.getAttribute("userId"); - userPermissionDTO.setUserId(userId); - try { - boolean success = permissionService.assignPermissions(userPermissionDTO, currentUserId); - securityAuditSupport.success(request, SecurityAuditActions.PERMISSION_ASSIGN, "targetUserId=" + userId + ",result=" + success); - return Result.success(success); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.PERMISSION_ASSIGN, "targetUserId=" + userId + ",reason=" + exception.getMessage()); - throw exception; - } - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminSecurityAuditController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminSecurityAuditController.java deleted file mode 100644 index d6903723..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminSecurityAuditController.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.security.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.security.service.SecurityAuditLogService; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import com.xiaowang.fingertipdesigner.core.modules.security.vo.SecurityAuditLogVO; -import lombok.RequiredArgsConstructor; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeParseException; - -@RestController -@RequestMapping("/admin/security-audit") -@RequiredArgsConstructor -/** - * Purpose: AdminSecurityAuditController supports AdminSecurityAuditController.java by holding or executing the admin security audit controller business role. - * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. - */ -public class AdminSecurityAuditController { - - private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - - /** - * Purpose: securityAuditLogService supports AdminSecurityAuditController.java by holding or executing the security audit log service business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private final SecurityAuditLogService securityAuditLogService; - - @GetMapping("/logs") - @RequirePermission("security:audit:view") - public Result> listLogs( - @RequestParam(required = false) String account, - @RequestParam(required = false) String action, - @RequestParam(required = false) String result, - @RequestParam(required = false) String startTime, - @RequestParam(required = false) String endTime, - @RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "20") Integer size) { - return Result.success(securityAuditLogService.pageLogs( - account, - action, - result, - parseDateTime(startTime), - parseDateTime(endTime), - page, - size - )); - } - - /** - * Purpose: parseDateTime supports AdminSecurityAuditController.java by holding or executing the parse date time business role. - * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. - */ - private LocalDateTime parseDateTime(String value) { - if (!StringUtils.hasText(value)) { - return null; - } - try { - return LocalDateTime.parse(value.trim(), DATE_TIME_FORMATTER); - } catch (DateTimeParseException exception) { - return LocalDateTime.parse(value.trim()); - } - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminShopRoleController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminShopRoleController.java deleted file mode 100644 index 77dd9d49..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/admin/AdminShopRoleController.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.security.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.user.dto.InviteCodeDTO; -import com.xiaowang.fingertipdesigner.core.modules.security.dto.ShopRoleDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.security.service.PermissionService; -import com.xiaowang.fingertipdesigner.core.modules.security.service.ShopRoleService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.user.vo.InviteCodeVO; -import com.xiaowang.fingertipdesigner.core.modules.security.vo.PermissionVO; -import com.xiaowang.fingertipdesigner.core.modules.security.vo.ShopRoleVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; - -@RestController -@RequestMapping("/admin/shop-role") -@RequiredArgsConstructor -/** - * AdminShopRoleController exposes HTTP endpoints. Start here to learn the request path, parameter names, and which service method is called. - * Beginner guide: follow the call chain Controller -> Service -> ServiceImpl -> Mapper/support class. - */ -public class AdminShopRoleController { - /** - * Variable `shopRoleService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final ShopRoleService shopRoleService; - /** - * Variable `permissionService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final PermissionService permissionService; - /** - * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final AdminScopeHelper adminScopeHelper; - - @GetMapping("/list") - @RequirePermission("role:view") - // 店铺角色是“只在本店生效”的角色,不是全局后台角色; - // 所以这里要先按当前登录人的店铺范围裁剪,再返回列表。 - public Result> list(HttpServletRequest request, @RequestParam(required = false) Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(shopRoleService.listRoles(currentUser, shopId)); - } - - @PostMapping("/create") - @RequirePermission("role:create") - /** - * Create a new record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param dto parameter `dto` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result create(HttpServletRequest request, @Valid @RequestBody ShopRoleDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(shopRoleService.createRole(currentUser, dto)); - } - - @PutMapping("/{id}") - @RequirePermission("role:edit") - /** - * Update an existing record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @param dto parameter `dto` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result update(HttpServletRequest request, @PathVariable Long id, @RequestBody ShopRoleDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(shopRoleService.updateRole(currentUser, id, dto)); - } - - @DeleteMapping("/{id}") - @RequirePermission("role:delete") - /** - * Delete, revoke, or logically remove a record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result delete(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(shopRoleService.deleteRole(currentUser, id)); - } - - @PostMapping("/{id}/permissions") - @RequirePermission("role:edit") - /** - * Run business method `assignPermissions`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @param permissionIds parameter `permissionIds` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result assignPermissions(HttpServletRequest request, @PathVariable Long id, @RequestBody List permissionIds) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(shopRoleService.assignPermissions(currentUser, id, permissionIds)); - } - - @PostMapping("/{id}/users") - @RequirePermission("role:edit") - /** - * Run business method `assignUsers`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @param userIds parameter `userIds` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result assignUsers(HttpServletRequest request, @PathVariable Long id, @RequestBody List userIds) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(shopRoleService.assignUsers(currentUser, id, userIds)); - } - - @GetMapping("/permission-options") - @RequirePermission("role:view") - /** - * Run business method `permissionOptions`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @return Result> result consumed by the caller or returned to the frontend - */ - public Result> permissionOptions() { - return Result.success(permissionService.listAllPermissions()); - } - - @GetMapping("/invite-code/list") - @RequirePermission("user:relation:view") - /** - * Purpose: listInviteCodes supports AdminShopRoleController.java by holding or executing the list invite codes business role. - * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. - */ - public Result> listInviteCodes(HttpServletRequest request, @RequestParam(required = false) Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(shopRoleService.listInviteCodes(currentUser, shopId)); - } - - @PostMapping("/invite-code/create") - @RequirePermission("user:relation:edit") - /** - * Create a new record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param dto parameter `dto` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result createInviteCode(HttpServletRequest request, @Valid @RequestBody InviteCodeDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(shopRoleService.createInviteCode(currentUser, dto)); - } - - @PutMapping("/invite-code/{id}/status") - @RequirePermission("user:relation:edit") - /** - * Update an existing record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @param status parameter `status` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result updateInviteCodeStatus(HttpServletRequest request, @PathVariable Long id, @RequestParam Integer status) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(shopRoleService.updateInviteCodeStatus(currentUser, id, status)); - } - - @GetMapping("/invite-code/resolve") - // 注册页输入邀请码时调用这个接口,用来提前展示“会归属到谁、哪个店”。 - /** - * Run business method `resolve`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param code parameter `code` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result resolve(@RequestParam String code) { - return Result.success(shopRoleService.resolveInviteCode(code)); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/controller/admin/AdminShopController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/controller/admin/AdminShopController.java deleted file mode 100644 index 939cf993..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/controller/admin/AdminShopController.java +++ /dev/null @@ -1,195 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.shop.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.shop.dto.ShopDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.shop.service.ShopService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditActions; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditSupport; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import com.xiaowang.fingertipdesigner.core.modules.shop.vo.ShopVO; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -@RestController -@RequestMapping("/admin/shops") -@RequiredArgsConstructor -/** - * AdminShopController exposes HTTP endpoints. Start here to learn the request path, parameter names, and which service method is called. - * Beginner guide: follow the call chain Controller -> Service -> ServiceImpl -> Mapper/support class. - */ -public class AdminShopController { - /** - * Variable `shopService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final ShopService shopService; - /** - * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final AdminScopeHelper adminScopeHelper; - /** - * Purpose: securityAuditSupport supports AdminShopController.java by holding or executing the security audit support business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private final SecurityAuditSupport securityAuditSupport; - - @GetMapping("/list") - @RequirePermission("shop:view") - public Result> listShops( - HttpServletRequest request, - @RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "10") Integer size, - @RequestParam(required = false) String keyword, - @RequestParam(required = false) Long shopId - ) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - shopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - PageResultVO result = shopService.pageShops(page, size, keyword, shopId); - return Result.success(result); - } - - @PostMapping("/create") - @RequirePermission("shop:create") - @OperationGuard(action = "admin-shop-create", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - /** - * Create a new record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param shopDTO parameter `shopDTO` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result createShop(HttpServletRequest request, @RequestBody ShopDTO shopDTO) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - adminScopeHelper.requirePlatformAdmin(currentUser, "只有平台管理员可以创建店铺"); - Long id = shopService.createShop(shopDTO); - return Result.success(id); - } - - @PutMapping("/update/{id}") - @RequirePermission("shop:edit") - @OperationGuard(action = "admin-shop-update", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - /** - * Update an existing record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @param shopDTO parameter `shopDTO` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result updateShop(HttpServletRequest request, @PathVariable Long id, @RequestBody ShopDTO shopDTO) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - ShopVO shopVO = shopService.getShopById(id); - if (shopVO == null) { - return Result.success(false); - } - adminScopeHelper.ensureShopAccessible(currentUser, shopVO.getId(), "无权编辑其他店铺信息"); - if (!adminScopeHelper.isPlatformAdmin(currentUser)) { - shopDTO.setAuthorizationExpireTime(shopVO.getAuthorizationExpireTime()); - } - boolean success = shopService.updateShop(id, shopDTO); - return Result.success(success); - } - - @DeleteMapping("/delete/{id}") - @RequirePermission("shop:delete") - @OperationGuard(action = "admin-shop-delete", ttlSeconds = 10, message = "操作处理中,请勿重复提交") - /** - * Delete, revoke, or logically remove a record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result deleteShop(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - adminScopeHelper.requirePlatformAdmin(currentUser, "只有平台管理员可以删除店铺"); - try { - boolean success = shopService.deleteShop(id); - securityAuditSupport.success(request, SecurityAuditActions.SHOP_DELETE_BLOCKED, "shopId=" + id + ",result=" + success); - return Result.success(success); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.SHOP_DELETE_BLOCKED, "shopId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @PutMapping("/status/{id}") - @RequirePermission("shop:edit") - @OperationGuard(action = "admin-shop-status", ttlSeconds = 10, message = "操作处理中,请勿重复提交") - /** - * Update an existing record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @param statusRequest parameter `statusRequest` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result updateShopStatus(HttpServletRequest request, @PathVariable Long id, @RequestBody StatusRequest statusRequest) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - adminScopeHelper.requirePlatformAdmin(currentUser, "只有平台管理员可以启停店铺"); - try { - boolean success = shopService.updateShopStatus(id, statusRequest.getStatus()); - securityAuditSupport.success(request, SecurityAuditActions.SHOP_STATUS_UPDATE, "shopId=" + id + ",status=" + statusRequest.getStatus()); - return Result.success(success); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.SHOP_STATUS_UPDATE, "shopId=" + id + ",status=" + statusRequest.getStatus() + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @GetMapping("/list/all") - @RequirePermission("shop:view") - /** - * List records for the current query or current user scope. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @return Result> result consumed by the caller or returned to the frontend - */ - public Result> listAllShops(HttpServletRequest request) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - List shops; - if (adminScopeHelper.isPlatformAdmin(currentUser)) { - shops = shopService.listAllShopsForAdmin(); - } else { - ShopVO currentShop = shopService.getShopById(adminScopeHelper.getManagedShopId(currentUser)); - shops = currentShop == null ? List.of() : List.of(currentShop); - } - return Result.success(shops); - } - - @GetMapping("/{id}") - @RequirePermission("shop:view") - /** - * Load data by the supplied parameter. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result getShop(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - adminScopeHelper.ensureShopAccessible(currentUser, id, "无权查看其他店铺信息"); - ShopVO shop = shopService.getShopById(id); - return Result.success(shop); - } - - @Data - /** - * Purpose: StatusRequest supports AdminShopController.java by holding or executing the status request business role. - * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. - */ - public static class StatusRequest { - /** - * Purpose: status supports AdminShopController.java by holding or executing the status business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private Integer status; - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/admin/AdminLegalAgreementController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/admin/AdminLegalAgreementController.java deleted file mode 100644 index 11836847..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/admin/AdminLegalAgreementController.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.system.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.system.dto.LegalAgreementDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.system.service.LegalAgreementService; -import com.xiaowang.fingertipdesigner.core.modules.security.service.SecurityAuditLogService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.system.vo.LegalAgreementVO; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; - -@RestController -@RequiredArgsConstructor -@RequestMapping("/admin/legal-agreement") -/** - * Purpose: AdminLegalAgreementController supports AdminLegalAgreementController.java by holding or executing the admin legal agreement controller business role. - * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. - */ -public class AdminLegalAgreementController { - - /** - * Purpose: legalAgreementService supports AdminLegalAgreementController.java by holding or executing the legal agreement service business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private final LegalAgreementService legalAgreementService; - /** - * Purpose: adminScopeHelper supports AdminLegalAgreementController.java by holding or executing the admin scope helper business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private final AdminScopeHelper adminScopeHelper; - /** - * Purpose: securityAuditLogService supports AdminLegalAgreementController.java by holding or executing the security audit log service business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private final SecurityAuditLogService securityAuditLogService; - - @GetMapping("/list") - @RequirePermission("legal_agreement:manage") - /** - * Purpose: list supports AdminLegalAgreementController.java by holding or executing the list business role. - * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. - */ - public Result> list(HttpServletRequest request) { - return Result.success(legalAgreementService.listAdminAgreements(adminScopeHelper.getCurrentUser(request))); - } - - @PostMapping("/create") - @RequirePermission("legal_agreement:manage") - @OperationGuard(action = "admin-legal-agreement-create", ttlSeconds = 8, message = "协议保存处理中,请勿重复提交") - /** - * Purpose: create supports AdminLegalAgreementController.java by holding or executing the create business role. - * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. - */ - public Result create(HttpServletRequest request, @Valid @RequestBody LegalAgreementDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Long id = legalAgreementService.createAgreement(currentUser, dto); - securityAuditLogService.record(currentUser.getId(), currentUser.getAccount(), "LEGAL_AGREEMENT_CREATE", "SUCCESS", dto.getAgreementType(), request); - return Result.success(id); - } - - @PutMapping("/{id}") - @RequirePermission("legal_agreement:manage") - @OperationGuard(action = "admin-legal-agreement-update", ttlSeconds = 8, message = "协议保存处理中,请勿重复提交") - /** - * Purpose: update supports AdminLegalAgreementController.java by holding or executing the update business role. - * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. - */ - public Result update(HttpServletRequest request, @PathVariable Long id, @Valid @RequestBody LegalAgreementDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Boolean result = legalAgreementService.updateAgreement(currentUser, id, dto); - securityAuditLogService.record(currentUser.getId(), currentUser.getAccount(), "LEGAL_AGREEMENT_UPDATE", "SUCCESS", String.valueOf(id), request); - return Result.success(result); - } - - @PutMapping("/{id}/publish") - @RequirePermission("legal_agreement:manage") - @OperationGuard(action = "admin-legal-agreement-publish", ttlSeconds = 8, message = "协议发布处理中,请勿重复提交") - /** - * Purpose: publish supports AdminLegalAgreementController.java by holding or executing the publish business role. - * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. - */ - public Result publish(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Boolean result = legalAgreementService.publishAgreement(currentUser, id); - securityAuditLogService.record(currentUser.getId(), currentUser.getAccount(), "LEGAL_AGREEMENT_PUBLISH", "SUCCESS", String.valueOf(id), request); - return Result.success(result); - } - - @PutMapping("/{id}/disable") - @RequirePermission("legal_agreement:manage") - @OperationGuard(action = "admin-legal-agreement-disable", ttlSeconds = 8, message = "协议停用处理中,请勿重复提交") - /** - * Purpose: disable supports AdminLegalAgreementController.java by holding or executing the disable business role. - * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. - */ - public Result disable(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - Boolean result = legalAgreementService.disableAgreement(currentUser, id); - securityAuditLogService.record(currentUser.getId(), currentUser.getAccount(), "LEGAL_AGREEMENT_DISABLE", "SUCCESS", String.valueOf(id), request); - return Result.success(result); - } -} diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/controller/admin/AdminUserController.java b/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/controller/admin/AdminUserController.java deleted file mode 100644 index 8ff69dc5..00000000 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/controller/admin/AdminUserController.java +++ /dev/null @@ -1,519 +0,0 @@ -package com.xiaowang.fingertipdesigner.core.modules.user.controller.admin; - -import com.xiaowang.fingertipdesigner.core.annotation.RequirePermission; -import com.xiaowang.fingertipdesigner.core.annotation.OperationGuard; -import com.xiaowang.fingertipdesigner.core.common.Result; -import com.xiaowang.fingertipdesigner.core.modules.user.dto.AdminUserBalanceChangeDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.dto.AdminUserVipOverrideDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.dto.UserDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.dto.UserRelationUpdateDTO; -import com.xiaowang.fingertipdesigner.core.modules.user.entity.UserDO; -import com.xiaowang.fingertipdesigner.core.modules.user.service.UserAssetService; -import com.xiaowang.fingertipdesigner.core.modules.user.service.UserService; -import com.xiaowang.fingertipdesigner.core.modules.security.service.ShopRoleService; -import com.xiaowang.fingertipdesigner.core.modules.security.support.AdminScopeHelper; -import com.xiaowang.fingertipdesigner.core.modules.artist.support.BookableArtistSupport; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditActions; -import com.xiaowang.fingertipdesigner.core.modules.security.support.SecurityAuditSupport; -import com.xiaowang.fingertipdesigner.core.modules.payment.vo.BalanceChangeDetailVO; -import com.xiaowang.fingertipdesigner.core.common.vo.PageResultVO; -import com.xiaowang.fingertipdesigner.core.modules.user.vo.UserStatisticsVO; -import com.xiaowang.fingertipdesigner.core.modules.user.vo.UserAssetVO; -import com.xiaowang.fingertipdesigner.core.modules.user.vo.UserRelationVO; -import com.xiaowang.fingertipdesigner.core.modules.user.vo.UserVO; -import lombok.Data; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.stream.Collectors; - -@RestController -@RequestMapping("/admin/user") -@RequiredArgsConstructor -/** - * AdminUserController exposes HTTP endpoints. Start here to learn the request path, parameter names, and which service method is called. - * Beginner guide: follow the call chain Controller -> Service -> ServiceImpl -> Mapper/support class. - */ -public class AdminUserController { - /** - * Variable `userService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final UserService userService; - /** - * Variable `userAssetService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final UserAssetService userAssetService; - /** - * Variable `shopRoleService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final ShopRoleService shopRoleService; - /** - * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final AdminScopeHelper adminScopeHelper; - /** - * Variable `bookableArtistSupport`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. - */ - private final BookableArtistSupport bookableArtistSupport; - /** - * Purpose: securityAuditSupport supports AdminUserController.java by holding or executing the security audit support business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private final SecurityAuditSupport securityAuditSupport; - - @GetMapping("/list") - @RequirePermission("user:view") - public Result> listUsers( - HttpServletRequest request, - @RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "10") Integer size, - @RequestParam(required = false) String keyword, - @RequestParam(required = false) Long shopId, - @RequestParam(required = false) Integer type, - @RequestParam(required = false) Long roleId, - @RequestParam(required = false) Long parentUserId, - @RequestParam(required = false) String sourceType, - @RequestParam(required = false) Integer status, - @RequestParam(required = false) String vipLevel, - @RequestParam(required = false) String createdFrom, - @RequestParam(required = false) String createdTo, - @RequestParam(required = false) Boolean hasPhone, - @RequestParam(required = false) Boolean hasOrder - ) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - shopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - PageResultVO result = userService.pageUsers(page, size, keyword, shopId, type, roleId, parentUserId, sourceType, status, vipLevel, createdFrom, createdTo, hasPhone, hasOrder); - return Result.success(result); - } - - @GetMapping("/statistics") - @RequirePermission("user:view") - public Result statisticsUsers(HttpServletRequest request, - @RequestParam(required = false) String keyword, - @RequestParam(required = false) Long shopId, - @RequestParam(required = false) Integer type, - @RequestParam(required = false) Long roleId, - @RequestParam(required = false) Long parentUserId, - @RequestParam(required = false) String sourceType, - @RequestParam(required = false) Integer status, - @RequestParam(required = false) String vipLevel, - @RequestParam(required = false) String createdFrom, - @RequestParam(required = false) String createdTo, - @RequestParam(required = false) Boolean hasPhone, - @RequestParam(required = false) Boolean hasOrder) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - shopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - return Result.success(userService.statisticsUsers(keyword, shopId, type, roleId, parentUserId, sourceType, status, vipLevel, createdFrom, createdTo, hasPhone, hasOrder)); - } - - @GetMapping("/relation/me") - /** - * Load data by the supplied parameter. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result getMyRelation(HttpServletRequest request) { - Long userId = (Long) request.getAttribute("userId"); - return Result.success(userService.getCurrentUserRelation(userId)); - } - - @GetMapping("/relation/options") - @RequirePermission("user:relation:view") - /** - * Purpose: relationOptions supports AdminUserController.java by holding or executing the relation options business role. - * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. - */ - public Result> relationOptions(HttpServletRequest request, @RequestParam(required = false) Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(shopRoleService.listRelationOptions(currentUser, shopId)); - } - - @PutMapping("/{id}/relation") - @RequirePermission("user:relation:edit") - /** - * Update an existing record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @param dto parameter `dto` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result updateRelation(HttpServletRequest request, @PathVariable Long id, @RequestBody UserRelationUpdateDTO dto) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - return Result.success(shopRoleService.updateUserRelation(currentUser, id, dto)); - } - - @PostMapping("/create") - @RequirePermission("user:create") - @OperationGuard(action = "admin-user-create", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - /** - * Create a new record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param userDTO parameter `userDTO` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result createUser(HttpServletRequest request, @Valid @RequestBody UserDTO userDTO) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - adminScopeHelper.ensureAssignableUserType(currentUser, userDTO.getType()); - if (!adminScopeHelper.isPlatformAdmin(currentUser)) { - Long managedShopId = adminScopeHelper.getManagedShopId(currentUser); - userDTO.setShopId(managedShopId); - userDTO.setShopIds(List.of(managedShopId)); - } - Long id = userService.createUser(userDTO); - return Result.success(id); - } - - @PutMapping("/update/{id}") - @RequirePermission("user:edit") - @OperationGuard(action = "admin-user-update", ttlSeconds = 10, message = "保存处理中,请勿重复提交") - /** - * Update an existing record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @param userDTO parameter `userDTO` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result updateUser(HttpServletRequest request, @PathVariable Long id, @Valid @RequestBody UserDTO userDTO) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - UserVO targetUser = userService.getUserById(id); - if (targetUser == null) { - return Result.success(false); - } - adminScopeHelper.ensureShopAccessible(currentUser, targetUser.getShopId(), "无权编辑其他店铺用户"); - if (userDTO.getType() != null) { - adminScopeHelper.ensureAssignableUserType(currentUser, userDTO.getType()); - } - if (!adminScopeHelper.isPlatformAdmin(currentUser)) { - userDTO.setShopId(null); - userDTO.setShopIds(null); - } - boolean success = userService.updateUser(id, userDTO); - return Result.success(success); - } - - @PutMapping("/status/{id}") - @RequirePermission("user:disable") - @OperationGuard(action = "admin-user-status", ttlSeconds = 10, message = "操作处理中,请勿重复提交") - /** - * Update an existing record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param httpRequest parameter `httpRequest` supplied by the caller - * @param id parameter `id` supplied by the caller - * @param request parameter `request` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result updateUserStatus(HttpServletRequest httpRequest, @PathVariable Long id, @RequestBody StatusRequest request) { - UserDO currentUser = adminScopeHelper.getCurrentUser(httpRequest); - adminScopeHelper.requirePlatformAdmin(currentUser, "仅系统管理员可以停用用户"); - UserVO targetUser = userService.getUserById(id); - if (targetUser == null) { - return Result.success(false); - } - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, id, "无权变更其他店铺用户状态"); - if (Integer.valueOf(4).equals(targetUser.getType())) { - /** - * Run business method `RuntimeException`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @return throw new result consumed by the caller or returned to the frontend - */ - throw new RuntimeException("管理员账号不允许停用"); - } - try { - boolean success = userService.updateUserStatus(id, request.getStatus()); - securityAuditSupport.success(httpRequest, SecurityAuditActions.USER_STATUS_UPDATE, "targetUserId=" + id + ",status=" + request.getStatus()); - return Result.success(success); - } catch (RuntimeException exception) { - securityAuditSupport.fail(httpRequest, SecurityAuditActions.USER_STATUS_UPDATE, "targetUserId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @PostMapping("/reset-password/{userId}") - @RequirePermission("user:reset_password") - @OperationGuard(action = "admin-user-reset-password", ttlSeconds = 10, message = "操作处理中,请勿重复提交") - /** - * Run business method `resetPassword`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param userId parameter `userId` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result resetPassword(HttpServletRequest request, @PathVariable Long userId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - UserVO targetUser = userService.getUserById(userId); - if (targetUser == null) { - return Result.success(false); - } - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, userId, "无权重置其他店铺用户密码"); - Long currentUserId = (Long) request.getAttribute("userId"); - try { - boolean success = userService.resetPassword(userId, currentUserId); - securityAuditSupport.success(request, SecurityAuditActions.USER_RESET_PASSWORD, "targetUserId=" + userId + ",result=" + success); - return Result.success(success); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.USER_RESET_PASSWORD, "targetUserId=" + userId + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @DeleteMapping("/delete/{id}") - @RequirePermission("user:delete") - @OperationGuard(action = "admin-user-delete", ttlSeconds = 10, message = "操作处理中,请勿重复提交") - /** - * Delete, revoke, or logically remove a record. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result deleteUser(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - adminScopeHelper.requirePlatformAdmin(currentUser, "仅系统管理员可以删除用户"); - UserVO targetUser = userService.getUserById(id); - if (targetUser == null) { - return Result.success(false); - } - if (Integer.valueOf(4).equals(targetUser.getType())) { - /** - * Run business method `RuntimeException`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @return throw new result consumed by the caller or returned to the frontend - */ - throw new RuntimeException("管理员账号不允许删除"); - } - try { - boolean success = userService.deleteUser(id); - securityAuditSupport.success(request, SecurityAuditActions.USER_DELETE, "targetUserId=" + id + ",result=" + success); - return Result.success(success); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.USER_DELETE, "targetUserId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @PutMapping("/unbind/{id}") - @RequirePermission("user:unbind") - @OperationGuard(action = "admin-user-unbind", ttlSeconds = 10, message = "操作处理中,请勿重复提交") - /** - * Run business method `unbindUser`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result unbindUser(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - UserVO targetUser = userService.getUserById(id); - if (targetUser == null) { - return Result.success(false); - } - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, id, "无权解绑其他店铺用户"); - adminScopeHelper.ensureAssignableUserType(currentUser, targetUser.getType()); - if (Integer.valueOf(4).equals(targetUser.getType())) { - /** - * Run business method `RuntimeException`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @return throw new result consumed by the caller or returned to the frontend - */ - throw new RuntimeException("管理员账号不允许解绑"); - } - try { - boolean success = userService.unbindUserInShopWithOperator(id, currentUser.getShopId(), currentUser.getType()); - securityAuditSupport.success(request, SecurityAuditActions.USER_UNBIND, "targetUserId=" + id + ",result=" + success); - return Result.success(success); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.USER_UNBIND, "targetUserId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @GetMapping("/{id}/asset") - @RequirePermission("user:balance:view") - /** - * Load data by the supplied parameter. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result getUserAsset(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - UserVO targetUser = requireAccessibleUser(currentUser, id, "无权查看其他店铺用户资产"); - UserAssetVO assetVO = userAssetService.getUserAsset(targetUser.getId()); - return Result.success(assetVO); - } - - @GetMapping("/{id}/balance/history") - @RequirePermission("user:balance:view") - /** - * Load data by the supplied parameter. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @return Result> result consumed by the caller or returned to the frontend - */ - public Result> getUserBalanceHistory(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - UserVO targetUser = requireAccessibleUser(currentUser, id, "无权查看其他店铺用户余额流水"); - List history = userAssetService.listBalanceHistory(targetUser.getId()); - return Result.success(history); - } - - @PostMapping("/{id}/balance/change") - @RequirePermission("user:balance:manage") - @OperationGuard(action = "admin-user-balance-change", ttlSeconds = 15, message = "操作处理中,请勿重复提交") - public Result changeUserBalance( - HttpServletRequest request, - @PathVariable Long id, - @RequestBody AdminUserBalanceChangeDTO balanceChangeDTO - ) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - UserVO targetUser = requireAccessibleUser(currentUser, id, "无权调整其他店铺用户余额"); - try { - UserAssetVO assetVO = userAssetService.changeBalance(currentUser.getId(), targetUser.getId(), balanceChangeDTO); - securityAuditSupport.success(request, SecurityAuditActions.USER_BALANCE_CHANGE, "targetUserId=" + id); - return Result.success(assetVO); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.USER_BALANCE_CHANGE, "targetUserId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @PostMapping("/{id}/vip/override") - @RequirePermission("user:vip:manage") - @OperationGuard(action = "admin-user-vip-override", ttlSeconds = 15, message = "操作处理中,请勿重复提交") - public Result overrideUserVip( - HttpServletRequest request, - @PathVariable Long id, - @RequestBody AdminUserVipOverrideDTO vipOverrideDTO - ) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - UserVO targetUser = requireAccessibleUser(currentUser, id, "无权调整其他店铺用户 VIP"); - try { - UserAssetVO assetVO = userAssetService.overrideVip(currentUser.getId(), targetUser.getId(), vipOverrideDTO); - securityAuditSupport.success(request, SecurityAuditActions.USER_VIP_OVERRIDE, "targetUserId=" + id); - return Result.success(assetVO); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.USER_VIP_OVERRIDE, "targetUserId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @PostMapping("/{id}/vip/recalculate") - @RequirePermission("user:vip:manage") - @OperationGuard(action = "admin-user-vip-recalculate", ttlSeconds = 15, message = "操作处理中,请勿重复提交") - /** - * Run business method `recalculateUserVip`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @param id parameter `id` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result recalculateUserVip(HttpServletRequest request, @PathVariable Long id) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - UserVO targetUser = requireAccessibleUser(currentUser, id, "无权重算其他店铺用户 VIP"); - try { - UserAssetVO assetVO = userAssetService.recalculateVip(currentUser.getId(), targetUser.getId()); - securityAuditSupport.success(request, SecurityAuditActions.USER_VIP_RECALCULATE, "targetUserId=" + id); - return Result.success(assetVO); - } catch (RuntimeException exception) { - securityAuditSupport.fail(request, SecurityAuditActions.USER_VIP_RECALCULATE, "targetUserId=" + id + ",reason=" + exception.getMessage()); - throw exception; - } - } - - @GetMapping("/info") - /** - * Load data by the supplied parameter. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param request parameter `request` supplied by the caller - * @return Result result consumed by the caller or returned to the frontend - */ - public Result getUserInfo(HttpServletRequest request) { - Long userId = (Long) request.getAttribute("userId"); - UserVO userVO = userService.getUserById(userId); - return Result.success(userVO); - } - - /** - * 获取所有用户 - * @return 用户列表 - */ - @GetMapping("/list/all") - @RequirePermission("user:view") - public Result> listAllUsers(HttpServletRequest request) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - List users = adminScopeHelper.isPlatformAdmin(currentUser) - ? userService.listAllUsers() - : userService.listUsersByShopId(adminScopeHelper.getManagedShopId(currentUser)); - return Result.success(users); - } - - /** - * 获取美甲师列表 - * @param shopId 店铺ID(可选) - * @return 美甲师列表 - */ - @GetMapping("/list/artists") - @RequirePermission("user:view") - public Result> listArtists(HttpServletRequest request, @RequestParam(required = false) Long shopId) { - UserDO currentUser = adminScopeHelper.getCurrentUser(request); - shopId = adminScopeHelper.resolveShopScope(currentUser, shopId); - final Long resolvedScopeShopId = shopId; - List artists = userService.listAllUsers().stream() - .filter(user -> Integer.valueOf(2).equals(user.getType()) || Integer.valueOf(3).equals(user.getType())) - .filter(user -> bookableArtistSupport.isValidBookableArtist(resolvedScopeShopId, user.getId())) - .collect(Collectors.toList()); - // 用户类型 3 表示美甲师 - // 如果指定了店铺ID,则过滤该店铺的美甲师 - if (shopId != null) { - final Long resolvedShopId = shopId; - artists = artists.stream() - .filter(artist -> artist.getShopIds() != null && artist.getShopIds().contains(resolvedShopId)) - .collect(Collectors.toList()); - } - return Result.success(artists); - } - - /** - * Run business method `requireAccessibleUser`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param currentUser parameter `currentUser` supplied by the caller - * @param userId parameter `userId` supplied by the caller - * @param message parameter `message` supplied by the caller - * @return private UserVO result consumed by the caller or returned to the frontend - */ - private UserVO requireAccessibleUser(UserDO currentUser, Long userId, String message) { - UserVO targetUser = userService.getUserById(userId); - if (targetUser == null) { - /** - * Run business method `RuntimeException`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @return throw new result consumed by the caller or returned to the frontend - */ - throw new RuntimeException("目标用户不存在"); - } - adminScopeHelper.ensureUserAccessibleInCurrentShop(currentUser, userId, message); - return targetUser; - } - - @Data - /** - * Purpose: StatusRequest supports AdminUserController.java by holding or executing the status request business role. - * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. - */ - public static class StatusRequest { - /** - * Purpose: status supports AdminUserController.java by holding or executing the status business role. - * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. - */ - private Integer status; - } -} diff --git a/FM-Frontend/src/api/admin.ts b/FM-Frontend/src/api/admin.ts deleted file mode 100644 index 700d9423..00000000 --- a/FM-Frontend/src/api/admin.ts +++ /dev/null @@ -1,1976 +0,0 @@ -/** - * Front-end API wrapper for this module. - * Call guide: import the named API object, then call the matching method from a Vue page or composable. - */ -import axios, { AxiosError, type AxiosProgressEvent } from 'axios' -import { message } from 'ant-design-vue' -import { ADMIN_API_BASE_URL } from '../config/api' -import type { IdType } from '@/utils/id' -import { clearAdminSessionStorage } from '@/utils/admin-session' -import { attachRequestSignature } from '@/utils/request-signature' -import { isAdminApiAuthFreePath } from './auth-free-paths' - -/** - * Purpose: lastErrorTime supports admin.ts by holding or executing the last error time page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let lastErrorTime = 0 -/** - * Purpose: lastErrorMessage supports admin.ts by holding or executing the last error message page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let lastErrorMessage = '' -/** - * Purpose: ERROR_DEBOUNCE_TIME supports admin.ts by holding or executing the error debounce time page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const ERROR_DEBOUNCE_TIME = 1000 - -/** - * Purpose: adminApi supports admin.ts by holding or executing the admin api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const adminApi = axios.create({ - baseURL: ADMIN_API_BASE_URL, - timeout: 60000, - headers: { - 'Content-Type': 'application/json' - } -}) - -/** - * Purpose: isRefreshing supports admin.ts by holding or executing the is refreshing page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let isRefreshing = false -let failedQueue: Array<{ - resolve: (value?: any) => void - reject: (reason?: any) => void -}> = [] - -/** - * Purpose: processQueue supports admin.ts by holding or executing the process queue page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const processQueue = (error: any, token: string | null = null) => { - failedQueue.forEach(prom => { - if (error) { - prom.reject(error) - } else { - prom.resolve(token) - } - }) - failedQueue = [] -} - -/** - * Purpose: getStoredAdminAccessToken supports admin.ts by holding or executing the get stored admin access token page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const getStoredAdminAccessToken = () => { - return localStorage.getItem('adminAccessToken') || sessionStorage.getItem('adminAccessToken') -} - -/** - * Purpose: getRequestToken supports admin.ts by holding or executing the get request token page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const getRequestToken = (request: any) => { - if (request?._authToken) { - return request._authToken as string - } - const authHeader = request?.headers?.Authorization || request?.headers?.authorization - if (typeof authHeader !== 'string') { - return null - } - return authHeader.startsWith('Bearer ') ? authHeader.slice('Bearer '.length) : null -} - -/** - * Purpose: isCurrentStoredAdminToken supports admin.ts by holding or executing the is current stored admin token page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const isCurrentStoredAdminToken = (token: string | null) => { - return Boolean(token && token === getStoredAdminAccessToken()) -} - -/** - * Purpose: showError supports admin.ts by holding or executing the show error page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const showError = (msg: string) => { - const now = Date.now() - if (now - lastErrorTime > ERROR_DEBOUNCE_TIME || msg !== lastErrorMessage) { - lastErrorTime = now - lastErrorMessage = msg - message.error(msg) - } -} - -/** - * Purpose: isAuthFreePath supports admin.ts by holding or executing the is auth free path page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const isAuthFreePath = (url?: string) => { - return isAdminApiAuthFreePath(url) -} - -/** - * Purpose: handleAdminTokenExpired supports admin.ts by holding or executing the handle admin token expired page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const handleAdminTokenExpired = (failedToken: string | null = null) => { - if (!isCurrentStoredAdminToken(failedToken)) { - return - } - - clearAdminSessionStorage() - - if (Date.now() - lastErrorTime > ERROR_DEBOUNCE_TIME || lastErrorMessage !== '登录已过期,请重新登录') { - showError('登录已过期,请重新登录') - } - - setTimeout(() => { - window.location.href = '/admin/login' - }, 300) -} - -adminApi.interceptors.request.use( - async config => { - let token: string | null = null - if (!isAuthFreePath(config.url)) { - token = getStoredAdminAccessToken() - if (token) { - config.headers.Authorization = `Bearer ${token}` - } - } - ;(config as any)._authToken = token || null - return attachRequestSignature(config, token, { - authFree: isAuthFreePath(config.url) - }) - }, - error => Promise.reject(error) -) - -adminApi.interceptors.response.use( - response => { - const res = response.data - if (res.code !== 200) { - const errorMsg = res.message || '请求失败' - if (!errorMsg.includes('权限') && !errorMsg.includes('permission')) { - showError(errorMsg) - } else { - console.error('权限不足:', errorMsg) - } - return Promise.reject(new Error(errorMsg)) - } - return res.data as any - }, - async (error: AxiosError) => { - const originalRequest = error.config as any - - if (error.response?.status === 401) { - const requestToken = getRequestToken(originalRequest) - - if (!isCurrentStoredAdminToken(requestToken)) { - return Promise.reject(error) - } - - if (!originalRequest?._retry && !isAuthFreePath(originalRequest?.url)) { - if (isRefreshing) { - return new Promise((resolve, reject) => { - failedQueue.push({ resolve, reject }) - }).then(token => { - if (token) { - originalRequest.headers.Authorization = `Bearer ${token}` - } - return adminApi(originalRequest) - }) - } - - originalRequest._retry = true - isRefreshing = true - - try { - let refreshToken = localStorage.getItem('adminRefreshToken') - if (!refreshToken) { - refreshToken = sessionStorage.getItem('adminRefreshToken') - } - if (!refreshToken) { - throw new Error('No refresh token available') - } - - const response = await adminAuthApi.refreshToken(refreshToken) - const newToken = (response as any).accessToken - const newRefreshToken = (response as any).refreshToken - - localStorage.setItem('adminAccessToken', newToken) - localStorage.setItem('adminRefreshToken', newRefreshToken) - sessionStorage.setItem('adminAccessToken', newToken) - sessionStorage.setItem('adminRefreshToken', newRefreshToken) - - processQueue(null, newToken) - originalRequest.headers.Authorization = `Bearer ${newToken}` - return adminApi(originalRequest) - } catch (refreshError) { - processQueue(refreshError, null) - handleAdminTokenExpired(requestToken) - return Promise.reject(refreshError) - } finally { - isRefreshing = false - } - } - - handleAdminTokenExpired(requestToken) - } else if (error.response?.status !== 403) { - const errorMsg = (error.response?.data as any)?.message || error.message || '请求失败' - showError(errorMsg) - } else { - console.error('权限不足:', error) - } - - if (error.response?.status === 403) { - const errorMsg = (error.response?.data as any)?.message || '权限不足' - console.error('Admin API Permission Error:', errorMsg) - return Promise.reject(new Error(errorMsg)) - } - - console.error('Admin API Error:', error) - return Promise.reject(error) - } -) - -/** - * Purpose: AdminLoginRequest supports admin.ts by holding or executing the admin login request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface AdminLoginRequest { - account: string - password: string - shopId?: IdType -} - -/** - * Purpose: AdminLoginResponse supports admin.ts by holding or executing the admin login response page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface AdminLoginResponse { - accessToken: string - refreshToken: string - userInfo: any -} - -/** - * Purpose: LoginShopSelectionResponse supports admin.ts by holding or executing the login shop selection response page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface LoginShopSelectionResponse { - allowShoplessLogin: boolean - message: string - shops: Array<{ - id: IdType - shopName: string - }> -} - -/** - * Purpose: LegalAgreementAdminVO supports admin.ts by holding or executing the legal agreement admin vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface LegalAgreementAdminVO { - id: IdType - agreementType: 'USER_TERMS' | 'PRIVACY_POLICY' - agreementTypeName?: string - title: string - version: string - content: string - status: number - statusText?: string - effectiveTime?: string - createTime?: string - updateTime?: string -} - -/** - * Purpose: LegalAgreementAdminRequest supports admin.ts by holding or executing the legal agreement admin request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface LegalAgreementAdminRequest { - agreementType: 'USER_TERMS' | 'PRIVACY_POLICY' - title: string - version: string - content: string -} - -/** - * adminAuthApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminAuthApi = { - /** - * `login` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: AdminLoginRequest caller-supplied value for `data: AdminLoginRequest` - */ - login: (data: AdminLoginRequest) => { - return adminApi.post('/auth/login', data) - }, - /** - * `getLoginShops` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param account: string caller-supplied value for `account: string` - */ - getLoginShops: (account: string) => { - return adminApi.get(`/auth/login-shops/${encodeURIComponent(account)}`) - }, - /** - * `logout` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - logout: () => { - return adminApi.post('/auth/logout') - }, - /** - * `switchShop` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param shopId?: IdType caller-supplied value for `shopId?: IdType` - */ - switchShop: (shopId?: IdType) => { - return adminApi.post('/auth/switch-shop', { shopId }) - }, - /** - * `refreshToken` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param refreshToken: string caller-supplied value for `refreshToken: string` - */ - refreshToken: (refreshToken: string) => { - return adminApi.post<{ accessToken: string; refreshToken: string }>('/auth/refresh', { refreshToken }) - } -} - -/** - * Purpose: adminLegalAgreementApi supports admin.ts by holding or executing the admin legal agreement api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const adminLegalAgreementApi = { - list: () => adminApi.get('/legal-agreement/list'), - create: (data: LegalAgreementAdminRequest) => adminApi.post('/legal-agreement/create', data), - update: (id: IdType, data: LegalAgreementAdminRequest) => adminApi.put(`/legal-agreement/${id}`, data), - publish: (id: IdType) => adminApi.put(`/legal-agreement/${id}/publish`), - disable: (id: IdType) => adminApi.put(`/legal-agreement/${id}/disable`) -} - -/** - * Purpose: ObjectStorageFileVO supports admin.ts by holding or executing the object storage file vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface ObjectStorageFileVO { - id: IdType - fileName: string - fileUrl?: string - objectName?: string - primaryProvider?: string - primaryUrl?: string - backupProvider?: string - backupUrl?: string - fileSize: number - contentType: string - primaryUploadStatus?: number - backupUploadStatus?: number - backupRetryCount?: number - backupLastError?: string - backupUploadedAt?: string - backupLastRetryTime?: string - createTime: string -} - -/** - * Purpose: ChunkUploadInitRequest supports admin.ts by holding or executing the chunk upload init request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface ChunkUploadInitRequest { - fileName: string - fileSize: number - contentType: string - fileFingerprint: string - scene: string -} - -/** - * Purpose: ChunkUploadSessionVO supports admin.ts by holding or executing the chunk upload session vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface ChunkUploadSessionVO { - uploadId: string - chunkSize: number - totalChunks: number - uploadedChunks: number[] -} - -/** - * adminFileApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminFileApi = { - /** - * `uploadFile` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param file: File caller-supplied value for `file: File` - */ - uploadFile: (file: File) => { - const formData = new FormData() - formData.append('file', file) - return adminApi.post('/object-storage-file/upload', formData, { - headers: { - 'Content-Type': 'multipart/form-data' - } - }) as unknown as Promise - }, - /** - * `initChunkUpload` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: ChunkUploadInitRequest caller-supplied value for `data: ChunkUploadInitRequest` - */ - initChunkUpload: (data: ChunkUploadInitRequest) => { - return adminApi.post('/object-storage-file/upload/init', data) as unknown as Promise - }, - uploadChunk: ( - /** - * Purpose: data supports admin.ts by holding or executing the data page or API role. - * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. - */ - data: { uploadId: string; chunkIndex: number; totalChunks: number; chunk: Blob }, - config?: { signal?: AbortSignal; onUploadProgress?: (event: AxiosProgressEvent) => void } - ) => { - const formData = new FormData() - formData.append('uploadId', data.uploadId) - formData.append('chunkIndex', String(data.chunkIndex)) - formData.append('totalChunks', String(data.totalChunks)) - formData.append('chunk', data.chunk) - return adminApi.post('/object-storage-file/upload/chunk', formData, { - /** - * Purpose: headers supports admin.ts by holding or executing the headers page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - headers: { - 'Content-Type': 'multipart/form-data' - }, - /** - * Purpose: signal supports admin.ts by holding or executing the signal page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - signal: config?.signal, - /** - * Purpose: onUploadProgress supports admin.ts by holding or executing the on upload progress page or API role. - * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. - */ - onUploadProgress: config?.onUploadProgress - }) - }, - /** - * `completeChunkUpload` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param uploadId: string caller-supplied value for `uploadId: string` - */ - completeChunkUpload: (uploadId: string) => { - return adminApi.post('/object-storage-file/upload/complete', { uploadId }) as unknown as Promise - }, - /** - * `cancelChunkUpload` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param uploadId: string caller-supplied value for `uploadId: string` - */ - cancelChunkUpload: (uploadId: string) => { - return adminApi.delete(`/object-storage-file/upload/${uploadId}`) - }, - /** - * `getSignedUrl` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - getSignedUrl: (id: IdType) => { - return adminApi.get(`/object-storage-file/get-signed-url/${id}`) as unknown as Promise - } -} - -/** - * Purpose: Tag supports admin.ts by holding or executing the tag page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface Tag { - id: IdType - tagName: string - textColor?: string - bgColor?: string - borderColor?: string - sceneGroup?: string - displayName?: string - sortOrder?: number - frontVisible?: number - shopId?: IdType - shopName?: string - type?: number - typeName?: string - createTime: string - updateTime: string -} - -/** - * adminTagApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminTagApi = { - /** - * `listAllTags` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - listAllTags: () => { - return adminApi.get('/tag/list/all') as unknown as Promise - }, - /** - * `listTagsByShopId` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param shopId: IdType caller-supplied value for `shopId: IdType` - */ - listTagsByShopId: (shopId: IdType) => { - return adminApi.get(`/tag/list/by-shop/${shopId}`) as unknown as Promise - }, - /** - * `createTag` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType } caller-supplied value for `data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType }` - */ - createTag: (data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; sceneGroup?: string; displayName?: string; sortOrder?: number; frontVisible?: number; shopId?: IdType }) => { - return adminApi.post('/tag/create', data) - }, - /** - * `updateTag` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType } caller-supplied value for `data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType }` - */ - updateTag: (id: IdType, data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; sceneGroup?: string; displayName?: string; sortOrder?: number; frontVisible?: number; shopId?: IdType }) => { - return adminApi.put(`/tag/update/${id}`, data) - }, - /** - * `deleteTag` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - deleteTag: (id: IdType) => { - return adminApi.delete(`/tag/delete/${id}`) - } -} - -/** - * Purpose: Artist supports admin.ts by holding or executing the artist page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface Artist { - id: IdType - nickname: string - account: string - avatar?: string - shopId?: IdType - shopName?: string - createTime: string - updateTime: string -} - -/** - * adminArtistApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminArtistApi = { - /** - * `listArtists` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param shopId?: IdType caller-supplied value for `shopId?: IdType` - */ - listArtists: (shopId?: IdType) => { - const params: any = {} - if (shopId) { - params.shopId = shopId - } - return adminApi.get('/user/list/artists', { params }) - } -} - -/** - * Purpose: Coupon supports admin.ts by holding or executing the coupon page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface Coupon { - id: IdType - couponCode?: string - couponName: string - couponType: number - couponTypeName?: string - discountValue?: string - minAmount?: number - reduceAmount?: string - totalCount?: number - usedCount?: number - remainingCount?: number - startTime: string - endTime: string - status?: number - statusName?: string - shopId?: IdType - shopName?: string - couponScene?: string - requiredVipLevel?: string - autoMatch?: number - availableTags?: Tag[] - unavailableTags?: Tag[] - createTime: string - updateTime: string -} - -/** - * adminCouponApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminCouponApi = { - /** - * `listAllCoupons` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param shopId?: IdType caller-supplied value for `shopId?: IdType` - */ - listAllCoupons: (shopId?: IdType) => { - const params = shopId ? { shopId } : {} - return adminApi.get('/coupon/list/all', { params }) as unknown as Promise - }, - /** - * `createCoupon` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: any caller-supplied value for `data: any` - */ - createCoupon: (data: any) => { - return adminApi.post('/coupon/create', data) - }, - /** - * `updateCoupon` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param data: any caller-supplied value for `data: any` - */ - updateCoupon: (id: IdType, data: any) => { - return adminApi.put(`/coupon/update/${id}`, data) - }, - /** - * `deleteCoupon` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - deleteCoupon: (id: IdType) => { - return adminApi.delete(`/coupon/delete/${id}`) - }, - /** - * `distributeCoupon` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: any caller-supplied value for `data: any` - */ - distributeCoupon: (data: any) => { - return adminApi.post('/coupon/distribute', null, { params: data }) - } -} - -/** - * Purpose: AdminCommentVO supports admin.ts by holding or executing the admin comment vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface AdminCommentVO { - id: IdType - userId: IdType - userNickname?: string - shopId?: IdType - shopName?: string - productId?: IdType - productTitle?: string - commentContent: string - parentCommentId?: IdType - parentCommentContent?: string - createTime?: string -} - -/** - * adminCommentApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminCommentApi = { - /** - * `listComments` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param params: { productId?: IdType; userId?: IdType; shopId?: IdType; keyword?: string } caller-supplied value for `params: { productId?: IdType; userId?: IdType; shopId?: IdType; keyword?: string }` - */ - listComments: (params: { productId?: IdType; userId?: IdType; shopId?: IdType; keyword?: string }) => { - return adminApi.get('/comment/list', { params }) as unknown as Promise - }, - /** - * `deleteComment` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - deleteComment: (id: IdType) => { - return adminApi.delete(`/comment/delete/${id}`) as unknown as Promise - } -} - -/** - * Purpose: Product supports admin.ts by holding or executing the product page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface Product { - id: IdType - shopId: IdType - shopName?: string - title: string - description: string - targetAudience?: string - precautions?: string - price: number - approximateDuration?: string - tags?: string - tagList?: string[] - tagInfos?: any[] - imageFileIds?: string - imageUrls?: string[] - bookableArtists?: string - availableCoupons?: string - frontVisible?: number - sourceType?: string - likeCount?: number - collectCount?: number - createTime: string - updateTime: string -} - -/** - * adminProductApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminProductApi = { - /** - * `listProducts` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param params: { page: number; size: number; keyword?: string; shopId?: IdType } caller-supplied value for `params: { page: number; size: number; keyword?: string; shopId?: IdType }` - */ - listProducts: (params: { page: number; size: number; keyword?: string; shopId?: IdType; tagId?: IdType; minPrice?: number; maxPrice?: number; createdFrom?: string; createdTo?: string }) => { - return adminApi.get<{ list: Product[]; total: number; page: number; size: number }>('/product/list', { params }) - }, - /** - * `listAllProducts` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - listAllProducts: () => { - return adminApi.get('/product/list/all') - }, - /** - * `createProduct` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: any caller-supplied value for `data: any` - */ - createProduct: (data: any) => { - return adminApi.post('/product/create', data) - }, - /** - * `updateProduct` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param data: any caller-supplied value for `data: any` - */ - updateProduct: (id: IdType, data: any) => { - return adminApi.put(`/product/update/${id}`, data) - }, - /** - * `deleteProduct` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - deleteProduct: (id: IdType) => { - return adminApi.delete(`/product/delete/${id}`) - } -} - -/** - * Purpose: Shop supports admin.ts by holding or executing the shop page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface Shop { - id: IdType - shopName: string - description: string - address: string - mapProvider?: string - longitude?: number | string - latitude?: number | string - businessHours: string - status?: number - coverImageFileId?: string - coverImageUrls?: string[] - imageFileIds?: string - imageUrls?: string[] - themePrimaryColor?: string - themeSecondaryColor?: string - themeAccentColor?: string - themePageBgColor?: string - themeCardBgColor?: string - themeBackgroundImageFileId?: string - authorizationStartDate?: string - authorizationDays?: number - authorizationExpireTime?: string - authorizationExpired?: boolean - authorizationStatusText?: string - createTime: string - updateTime: string -} - -/** - * Purpose: ShopListResponse supports admin.ts by holding or executing the shop list response page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface ShopListResponse { - list: Shop[] - total: number - page: number - size: number -} - -/** - * Purpose: CreateShopRequest supports admin.ts by holding or executing the create shop request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface CreateShopRequest { - shopName: string - description: string - address: string - mapProvider?: string - longitude?: number | string - latitude?: number | string - businessHours: string - coverImageFileId?: string - imageFileIds?: string - themePrimaryColor?: string - themeSecondaryColor?: string - themeAccentColor?: string - themePageBgColor?: string - themeCardBgColor?: string - themeBackgroundImageFileId?: string - status?: number - authorizationStartDate?: string - authorizationDays?: number - authorizationExpireTime?: string -} - -/** - * adminShopApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminShopApi = { - /** - * `listShops` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param params: { page: number; size: number; keyword?: string; shopId?: IdType } caller-supplied value for `params: { page: number; size: number; keyword?: string; shopId?: IdType }` - */ - listShops: (params: { page: number; size: number; keyword?: string; shopId?: IdType }) => { - return adminApi.get('/shops/list', { params }) as unknown as Promise - }, - /** - * `listAllShops` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - listAllShops: () => { - return adminApi.get('/shops/list/all') as unknown as Promise - }, - /** - * `createShop` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: CreateShopRequest caller-supplied value for `data: CreateShopRequest` - */ - createShop: (data: CreateShopRequest) => { - return adminApi.post('/shops/create', data) - }, - /** - * `updateShop` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param data: CreateShopRequest caller-supplied value for `data: CreateShopRequest` - */ - updateShop: (id: IdType, data: CreateShopRequest) => { - return adminApi.put(`/shops/update/${id}`, data) - }, - /** - * `updateShopStatus` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param status: number caller-supplied value for `status: number` - */ - updateShopStatus: (id: IdType, status: number) => { - return adminApi.put(`/shops/status/${id}`, { status }) - } -} - -/** - * Purpose: UserVO supports admin.ts by holding or executing the user vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface UserVO { - id: IdType - shopId?: IdType - shopName?: string - shopAuthorizationExpireTime?: string - shopAuthorizationExpired?: boolean - shopIds?: IdType[] - shopNames?: string[] - nickname: string - account: string - avatar: string - phone?: string - contactPhone?: string - birthday?: string - wechatId?: string - wechatQrCode?: string - signature?: string - level?: string - type: number - vipId?: IdType - createTime: string - updateTime: string - status?: number -} - -/** - * Purpose: UserRelationVO supports admin.ts by holding or executing the user relation vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface UserRelationVO { - userId: IdType - shopId?: IdType - shopName?: string - parentUserId?: IdType - parentUserName?: string - parentRoleType?: number - parentRoleTypeName?: string - sourceType?: string - sourceTypeName?: string -} - -/** - * Purpose: UserStatisticsVO supports admin.ts by holding or executing the user statistics vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface UserStatisticsVO { - totalUserCount: number - normalUserCount: number - employeeCount: number - managerCount: number - artistCount: number - vipUserCount: number - newUserCount: number - byShop?: Record - byRole?: Record - byParent?: Record -} - -/** - * Purpose: PageResult supports admin.ts by holding or executing the page result page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface PageResult { - list: T[] - total: number - page: number - size: number -} - -export interface ArtistScheduleVO { - id: IdType - shopId?: IdType - artistId: IdType - workDate: string - startTime: string - endTime: string - slotMinutes?: number - capacity?: number - status?: number - remark?: string - createTime?: string -} - -export interface ArtistScheduleRequest { - shopId?: IdType - artistId?: IdType - workDate?: string - startTime?: string - endTime?: string - slotMinutes?: number - capacity?: number - status?: number - remark?: string -} - -export interface ArtistScheduleQuery { - artistId?: IdType - startDate?: string - endDate?: string -} - -export interface PaymentOrderVO { - id: IdType - payNo?: string - orderId: IdType - orderNo?: string - userId?: IdType - shopId?: IdType - channel?: string - status?: string - payAmount?: number - paidAmount?: number - payTime?: string - expireTime?: string - remark?: string -} - -export interface AfterSaleVO { - id: IdType - afterSaleNo?: string - orderId: IdType - orderItemId?: IdType - userId?: IdType - shopId?: IdType - type?: string - reason?: string - refundAmount?: number - status?: string - auditUserId?: IdType - auditReason?: string - auditTime?: string - refundOrderId?: IdType - createTime?: string -} - -export interface AfterSaleAuditRequest { - auditReason?: string -} - -export interface AfterSaleQuery { - status?: string - page: number - size: number -} - -export interface InventoryItemVO { - id: IdType - shopId?: IdType - category?: string - itemName: string - unit?: string - stockQuantity?: number - warningThreshold?: number - warning?: boolean - status?: number -} - -export interface InventoryItemRequest { - shopId?: IdType - category?: string - itemName?: string - unit?: string - stockQuantity?: number - warningThreshold?: number - status?: number -} - -export interface InventoryAdjustRequest { - changeType?: string - changeQuantity?: number - remark?: string -} - -export interface CampaignVO { - id: IdType - shopId?: IdType - title: string - description?: string - scene?: string - productIds?: string - couponIds?: string - status?: number - startTime?: string - endTime?: string - sortOrder?: number -} - -export interface CampaignRequest { - shopId?: IdType - title?: string - description?: string - scene?: string - productIds?: string - couponIds?: string - status?: number - startTime?: string - endTime?: string - sortOrder?: number -} - -export interface OperationsAnalyticsVO { - viewCount?: number - favoriteCount?: number - cartCount?: number - orderCount?: number - paidOrderCount?: number - completedOrderCount?: number - reviewCount?: number - rebookCount?: number - totalAmount?: number -} - -export const adminArtistScheduleApi = { - listSchedules: (params: ArtistScheduleQuery = {}) => { - return adminApi.get('/artist-schedule/list', { params }) as unknown as Promise - }, - saveSchedule: (data: ArtistScheduleRequest) => { - return adminApi.post('/artist-schedule/save', data) as unknown as Promise - } -} - -export const adminPaymentApi = { - manualConfirmOrder: (orderId: IdType, remark?: string) => { - return adminApi.post(`/payment/order/${orderId}/manual-confirm`, undefined, { - params: { remark } - }) as unknown as Promise - } -} - -export const adminAfterSaleApi = { - listAfterSales: (params: AfterSaleQuery) => { - return adminApi.get>('/after-sale/list', { params }) as unknown as Promise> - }, - approveAfterSale: (id: IdType, data?: AfterSaleAuditRequest) => { - return adminApi.put(`/after-sale/${id}/approve`, data || {}) as unknown as Promise - }, - rejectAfterSale: (id: IdType, data?: AfterSaleAuditRequest) => { - return adminApi.put(`/after-sale/${id}/reject`, data || {}) as unknown as Promise - } -} - -export const adminInventoryApi = { - listItems: (params: { page: number; size: number }) => { - return adminApi.get>('/inventory/list', { params }) as unknown as Promise> - }, - saveItem: (data: InventoryItemRequest) => { - return adminApi.post('/inventory/save', data) as unknown as Promise - }, - adjustStock: (id: IdType, data: InventoryAdjustRequest) => { - return adminApi.post(`/inventory/${id}/adjust`, data) as unknown as Promise - } -} - -export const adminCampaignApi = { - listCampaigns: (params: { status?: number; page: number; size: number }) => { - return adminApi.get>('/campaign/list', { params }) as unknown as Promise> - }, - saveCampaign: (data: CampaignRequest) => { - return adminApi.post('/campaign/save', data) as unknown as Promise - } -} - -/** - * adminUserApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminUserApi = { - // 后台用户列表支持多维筛选;页面侧应优先展示 maskedPhone/maskedEmail, - // 避免在列表中直接暴露完整手机号或邮箱。 - /** - * `listUsers` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param params: { page: number; size: number; keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean } caller-supplied value for `params: { page: number; size: number; keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean }` - */ - listUsers: (params: { page: number; size: number; keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean }) => { - return adminApi.get>('/user/list', { params }) as unknown as Promise> - }, - /** - * `getUserStatistics` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param params: { keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean } caller-supplied value for `params: { keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean }` - */ - getUserStatistics: (params: { keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean }) => { - return adminApi.get('/user/statistics', { params }) as unknown as Promise - }, - /** - * `listAllUsers` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - listAllUsers: () => { - return adminApi.get('/user/list/all') as unknown as Promise - }, - /** - * `createUser` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: any caller-supplied value for `data: any` - */ - createUser: (data: any) => { - return adminApi.post('/user/create', data) - }, - /** - * `updateUser` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param data: any caller-supplied value for `data: any` - */ - updateUser: (id: IdType, data: any) => { - return adminApi.put(`/user/update/${id}`, data) - }, - /** - * `deleteUser` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - deleteUser: (id: IdType) => { - return adminApi.delete(`/user/delete/${id}`) - }, - /** - * `unbindUser` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - unbindUser: (id: IdType) => { - return adminApi.put(`/user/unbind/${id}`, {}) - }, - /** - * `updateUserStatus` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param status: number caller-supplied value for `status: number` - */ - updateUserStatus: (id: IdType, status: number) => { - return adminApi.put(`/user/status/${id}`, { status }) - }, - /** - * `getRelationOptions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param shopId?: IdType caller-supplied value for `shopId?: IdType` - */ - getRelationOptions: (shopId?: IdType) => { - return adminApi.get(`/user/relation/options`, { params: { shopId } }) as unknown as Promise - }, - /** - * `updateUserRelation` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param data: { shopId?: IdType; parentUserId?: IdType; parentRoleType?: number; sourceType?: string } caller-supplied value for `data: { shopId?: IdType; parentUserId?: IdType; parentRoleType?: number; sourceType?: string }` - */ - updateUserRelation: (id: IdType, data: { shopId?: IdType; parentUserId?: IdType; parentRoleType?: number; sourceType?: string }) => { - return adminApi.put(`/user/${id}/relation`, data) as unknown as Promise - }, - /** - * `resetPassword` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - resetPassword: (id: IdType) => { - return adminApi.post(`/user/reset-password/${id}`) - }, - /** - * `getUserInfo` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - getUserInfo: () => { - return adminApi.get('/user/info') as unknown as Promise - }, - /** - * `getUserAsset` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - getUserAsset: (id: IdType) => { - return adminApi.get(`/user/${id}/asset`) as unknown as Promise - }, - /** - * `getUserBalanceHistory` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - getUserBalanceHistory: (id: IdType) => { - return adminApi.get(`/user/${id}/balance/history`) as unknown as Promise - }, - /** - * `changeUserBalance` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param data: AdminUserBalanceChangeRequest caller-supplied value for `data: AdminUserBalanceChangeRequest` - */ - changeUserBalance: (id: IdType, data: AdminUserBalanceChangeRequest) => { - return adminApi.post(`/user/${id}/balance/change`, data) as unknown as Promise - }, - /** - * `overrideUserVip` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param data: AdminUserVipOverrideRequest caller-supplied value for `data: AdminUserVipOverrideRequest` - */ - overrideUserVip: (id: IdType, data: AdminUserVipOverrideRequest) => { - return adminApi.post(`/user/${id}/vip/override`, data) as unknown as Promise - }, - /** - * `recalculateUserVip` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - recalculateUserVip: (id: IdType) => { - return adminApi.post(`/user/${id}/vip/recalculate`) as unknown as Promise - } -} - -/** - * Purpose: UserAssetVO supports admin.ts by holding or executing the user asset vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface UserAssetVO { - userId: IdType - nickname: string - balance: number - totalRechargeAmount: number - lastRechargeTime?: string - vipInfoId?: IdType - vipLevel: string - benefitId?: IdType - benefitInfo?: string - manualOverride: boolean - vipStartTime?: string - vipExpireTime?: string -} - -/** - * Purpose: UserBalanceHistoryItem supports admin.ts by holding or executing the user balance history item page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface UserBalanceHistoryItem { - id: IdType - userId: IdType - userNickname?: string - amount: number - type?: string - currentBalance?: number - beforeBalance?: number - afterBalance?: number - changeScene?: string - relatedOrderId?: IdType - relatedOrderNo?: string - externalOrderNo?: string - operatorId?: IdType - remark?: string - changeTime: string -} - -/** - * Purpose: AdminUserBalanceChangeRequest supports admin.ts by holding or executing the admin user balance change request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface AdminUserBalanceChangeRequest { - amount: number - changeScene: string - relatedOrderId?: IdType - externalOrderNo?: string - remark?: string -} - -/** - * Purpose: AdminUserVipOverrideRequest supports admin.ts by holding or executing the admin user vip override request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface AdminUserVipOverrideRequest { - vipLevel: string - remark?: string -} - -/** - * Purpose: userApi supports admin.ts by holding or executing the user api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const userApi = adminUserApi - -/** - * Purpose: OrderVO supports admin.ts by holding or executing the order vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface OrderVO { - id: IdType - orderNo: string - userId: IdType - userNickname?: string - shopId: IdType - shopName?: string - artistId?: IdType - artistName?: string - totalAmount: number - actualAmount?: number - discountAmount: number - payAmount: number - paidAmount?: number - paymentStatus?: string - paymentMethod?: string - paymentOrderNo?: string - payTime?: string - refundStatus?: string - customerRemark?: string - quoteStatus?: string - quoteStatusText?: string - quoteUserConfirmed?: boolean - quoteShopConfirmed?: boolean - quoteExpireTime?: string - quoteConfirmedTime?: string - quoteMessages?: any[] - couponName?: string - customerName?: string - customerPhone?: string - customerNickname?: string - customerPhoneMasked?: string - items?: Array<{ - id: IdType - productId: IdType - productTitle?: string - artistId?: IdType - artistName?: string - appointmentTime?: string - price: number - referencePrice?: number - quotedPrice?: number - confirmedPrice?: number - quantity: number - }> - status: number - statusText?: string - remark?: string - createTime: string - updateTime: string -} - -/** - * adminOrderApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminOrderApi = { - /** - * `listOrders` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param params: { page: number; size: number; keyword?: string; status?: number; shopId?: IdType } caller-supplied value for `params: { page: number; size: number; keyword?: string; status?: number; shopId?: IdType }` - */ - listOrders: (params: { page: number; size: number; keyword?: string; status?: number; shopId?: IdType }) => { - return adminApi.get>('/order/list', { params }) - }, - /** - * `updateOrderStatus` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param status: number caller-supplied value for `status: number` - */ - updateOrderStatus: (id: IdType, status: number) => { - return adminApi.put(`/order/update-status/${id}`, {}, { params: { status } }) - }, - manualConfirmPayment: (id: IdType, remark?: string) => { - return adminPaymentApi.manualConfirmOrder(id, remark) - }, - submitQuote: (id: IdType, data: { remark?: string; items: Array<{ orderItemId: IdType; quotedPrice: number }> }) => { - return adminApi.post(`/order/${id}/quote`, data) - }, - confirmQuote: (id: IdType) => { - return adminApi.put(`/order/${id}/quote/confirm`) - } -} - -/** - * Purpose: HotProductVO supports admin.ts by holding or executing the hot product vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface HotProductVO { - id: IdType - title: string - price: number - likeCount: number - collectCount: number -} - -/** - * Purpose: RecentActivityVO supports admin.ts by holding or executing the recent activity vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface RecentActivityVO { - id: IdType - type: string - title?: string - description: string - time: string - color?: string -} - -/** - * Purpose: DashboardStats supports admin.ts by holding or executing the dashboard stats page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface DashboardStats { - totalUsers: number - totalProducts: number - totalShops: number - todayOrders: number - totalOrderAmount?: number - todayOrderAmount?: number - weekOrderAmount?: number - totalCustomers?: number - totalArtists?: number - newCustomersToday?: number - newCustomers7Days?: number - newOrders7Days?: number - pendingOrders?: number - completedOrders?: number - hotProducts: HotProductVO[] - recentActivities: RecentActivityVO[] -} - -/** - * adminDashboardApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminDashboardApi = { - /** - * `getStats` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - getStats: () => { - return adminApi.get('/dashboard/stats') - }, - getAnalytics: () => { - return adminApi.get('/dashboard/analytics') as unknown as Promise - } -} - -/** - * Purpose: NailArtistInfoVO supports admin.ts by holding or executing the nail artist info vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface NailArtistInfoVO { - id: IdType - userId: IdType - identity: string - experience: number - skills: string - rating: number - status: number - portfolio: string - nickname: string - shopId: IdType - shopName: string - userType?: number - userTypeName?: string - participateProduction?: number - workStartTime?: string - workEndTime?: string -} - -/** - * adminNailArtistApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminNailArtistApi = { - /** - * `listNailArtists` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - listNailArtists: () => { - return adminApi.get('/nail-artist/list') as unknown as Promise - }, - /** - * `getNailArtistInfo` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param userId: IdType caller-supplied value for `userId: IdType` - */ - getNailArtistInfo: (userId: IdType) => { - return adminApi.get(`/nail-artist/get/${userId}`) - }, - /** - * `saveNailArtistInfo` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: any caller-supplied value for `data: any` - */ - saveNailArtistInfo: (data: any) => { - return adminApi.post('/nail-artist/save', data) - } -} - -/** - * Purpose: SystemMessageVO supports admin.ts by holding or executing the system message vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface SystemMessageVO { - id: IdType - title: string - content: string - imageFileId?: IdType - imageUrl?: string - publisherId: IdType - publisherName?: string - publisherType: number - targetType: string - targetTypeName?: string - targetIds?: IdType[] - popupEnabled: number - status: number - publishTime?: string - createTime?: string - popupShown?: number - readStatus?: number -} - -/** - * Purpose: MessageTargetOptionsVO supports admin.ts by holding or executing the message target options vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface MessageTargetOptionsVO { - shops: Array<{ id: IdType; shopName: string }> - users: Array<{ id: IdType; nickname: string; account: string; shopId?: IdType; shopName?: string; type?: number }> -} - -/** - * Purpose: SystemMessageCreateRequest supports admin.ts by holding or executing the system message create request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface SystemMessageCreateRequest { - title: string - content: string - imageFileId?: IdType - targetType: string - shopIds?: IdType[] - userIds?: IdType[] - popupEnabled?: number -} - -/** - * adminSystemMessageApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminSystemMessageApi = { - // 消息通知会进入用户“消息通知”列表;如果 popupEnabled=1, - // 前端展示弹窗后必须调用 mark popup-shown,保证每人每条只弹一次。 - /** - * `listMessages` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - listMessages: () => { - return adminApi.get('/system-message/admin/list') as unknown as Promise - }, - /** - * `createMessage` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: SystemMessageCreateRequest caller-supplied value for `data: SystemMessageCreateRequest` - */ - createMessage: (data: SystemMessageCreateRequest) => { - return adminApi.post('/system-message/admin/create', data) - }, - /** - * `revokeMessage` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - revokeMessage: (id: IdType) => { - return adminApi.put(`/system-message/admin/${id}/revoke`) - }, - /** - * `getTargetOptions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - getTargetOptions: () => { - return adminApi.get('/system-message/admin/target-options') as unknown as Promise - } -} - -/** - * Purpose: AnnouncementVO supports admin.ts by holding or executing the announcement vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface AnnouncementVO { - id: IdType - title: string - content: string - publisherId?: IdType - publisherName?: string - publisherType?: number - targetType: string - targetTypeName?: string - targetIds?: IdType[] - status: number - sortOrder?: number - publishTime?: string - createTime?: string -} - -/** - * Purpose: AnnouncementCreateRequest supports admin.ts by holding or executing the announcement create request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface AnnouncementCreateRequest { - title: string - content: string - targetType: string - shopIds?: IdType[] - userIds?: IdType[] - sortOrder?: number -} - -/** - * adminAnnouncementApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminAnnouncementApi = { - // 公告只在首页顶部滚动显示,不写入消息已读/未读状态。 - /** - * `listAnnouncements` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - listAnnouncements: () => { - return adminApi.get('/announcement/admin/list') as unknown as Promise - }, - /** - * `createAnnouncement` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: AnnouncementCreateRequest caller-supplied value for `data: AnnouncementCreateRequest` - */ - createAnnouncement: (data: AnnouncementCreateRequest) => { - return adminApi.post('/announcement/admin/create', data) - }, - /** - * `revokeAnnouncement` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - revokeAnnouncement: (id: IdType) => { - return adminApi.put(`/announcement/admin/${id}/revoke`) - }, - /** - * `getTargetOptions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - getTargetOptions: () => { - return adminApi.get('/announcement/admin/target-options') as unknown as Promise - } -} - -/** - * Purpose: VipRechargePlanVO supports admin.ts by holding or executing the vip recharge plan vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface VipRechargePlanVO { - id: IdType - shopId: IdType - shopName?: string - title: string - rechargeAmount: number - giftAmount: number - vipLevel: string - description?: string - sortOrder?: number - status: number - createTime?: string - updateTime?: string -} - -/** - * Purpose: VipRechargePlanRequest supports admin.ts by holding or executing the vip recharge plan request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface VipRechargePlanRequest { - shopId?: IdType - title: string - rechargeAmount: number - giftAmount: number - vipLevel: string - description?: string - sortOrder?: number - status?: number -} - -/** - * adminVipRechargePlanApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminVipRechargePlanApi = { - /** - * `listPlans` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param shopId?: IdType caller-supplied value for `shopId?: IdType` - */ - listPlans: (shopId?: IdType) => { - const params = shopId ? { shopId } : {} - return adminApi.get('/vip-recharge-plan/admin/list', { params }) as unknown as Promise - }, - /** - * `createPlan` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: VipRechargePlanRequest caller-supplied value for `data: VipRechargePlanRequest` - */ - createPlan: (data: VipRechargePlanRequest) => { - return adminApi.post('/vip-recharge-plan/admin/create', data) - }, - /** - * `updatePlan` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param data: VipRechargePlanRequest caller-supplied value for `data: VipRechargePlanRequest` - */ - updatePlan: (id: IdType, data: VipRechargePlanRequest) => { - return adminApi.put(`/vip-recharge-plan/admin/${id}`, data) - }, - /** - * `updateStatus` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param status: number caller-supplied value for `status: number` - */ - updateStatus: (id: IdType, status: number) => { - return adminApi.put(`/vip-recharge-plan/admin/${id}/status`, null, { params: { status } }) - }, - /** - * `listVipLevelOptions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param shopId?: IdType caller-supplied value for `shopId?: IdType` - */ - listVipLevelOptions: (shopId?: IdType) => { - const params = shopId ? { shopId } : {} - return adminApi.get('/vip-recharge-plan/admin/vip-level-options', { params }) as unknown as Promise - } -} - -/** - * Purpose: MessageHubPushConfigVO supports admin.ts by holding or executing the message hub push config vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface MessageHubPushConfigVO { - id: IdType - sceneCode: string - sceneName: string - platform: string - msgType: string - queueName: string - sourceSystem: string - templateCode: string - channelId?: IdType - sendMethod?: string - enabled: number - remark?: string - createTime?: string - updateTime?: string -} - -/** - * Purpose: MessageHubPushConfigRequest supports admin.ts by holding or executing the message hub push config request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface MessageHubPushConfigRequest { - sceneCode: string - sceneName: string - platform: string - msgType: string - queueName: string - sourceSystem: string - templateCode: string - channelId?: IdType - sendMethod?: string - enabled?: number - remark?: string -} - -/** - * adminMessageHubPushConfigApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const adminMessageHubPushConfigApi = { - /** - * `listConfigs` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - listConfigs: () => { - return adminApi.get('/messagehub-push-config/admin/list') as unknown as Promise - }, - /** - * `createConfig` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: MessageHubPushConfigRequest caller-supplied value for `data: MessageHubPushConfigRequest` - */ - createConfig: (data: MessageHubPushConfigRequest) => { - return adminApi.post('/messagehub-push-config/admin/create', data) - }, - /** - * `updateConfig` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param data: MessageHubPushConfigRequest caller-supplied value for `data: MessageHubPushConfigRequest` - */ - updateConfig: (id: IdType, data: MessageHubPushConfigRequest) => { - return adminApi.put(`/messagehub-push-config/admin/${id}`, data) - }, - /** - * `updateStatus` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param enabled: number caller-supplied value for `enabled: number` - */ - updateStatus: (id: IdType, enabled: number) => { - return adminApi.put(`/messagehub-push-config/admin/${id}/status`, null, { params: { enabled } }) - }, - /** - * `testConfig` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param phone: string caller-supplied value for `phone: string` - */ - testConfig: (id: IdType, phone: string) => { - return adminApi.post(`/messagehub-push-config/admin/${id}/test`, { phone }) - } -} - -/** - * Purpose: SystemParameterConfigVO supports admin.ts by holding or executing the system parameter config vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface SystemParameterConfigVO { - id?: IdType - configGroup: string - configKey: string - configName: string - configValue: string - enabled: number - remark?: string - createTime?: string - updateTime?: string -} - -export interface AdminDefaultPasswordResponse { - password: string -} - -/** - * Purpose: adminSystemParameterConfigApi supports admin.ts by holding or executing the admin system parameter config api page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const adminSystemParameterConfigApi = { - listConfigs: (configGroup?: string) => { - return adminApi.get('/system-parameter-config/admin/list', { params: { configGroup } }) as unknown as Promise - }, - saveConfig: (data: SystemParameterConfigVO) => { - return adminApi.post('/system-parameter-config/admin/save', data) - }, - getTencentMapKey: () => { - return adminApi.get<{ key: string }>('/system-parameter-config/admin/tencent-map') as unknown as Promise<{ key: string }> - }, - getMapConfig: () => { - return adminApi.get<{ provider: 'TENCENT' | 'AMAP'; tencentWebKey?: string; amapWebKey?: string; amapMiniKey?: string }>('/system-parameter-config/admin/map-config') as unknown as Promise<{ provider: 'TENCENT' | 'AMAP'; tencentWebKey?: string; amapWebKey?: string; amapMiniKey?: string }> - }, - getUserDefaultPassword: () => { - return adminApi.get('/system-parameter-config/admin/user-default-password') as unknown as Promise - } -} - -export { adminApi } -export default adminApi diff --git a/FM-Frontend/src/api/permission.ts b/FM-Frontend/src/api/permission.ts deleted file mode 100644 index c927b779..00000000 --- a/FM-Frontend/src/api/permission.ts +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Front-end API wrapper for this module. - * Call guide: import the named API object, then call the matching method from a Vue page or composable. - */ -import { adminApi } from './admin' -import type { IdType } from '@/utils/id' - -/** - * Purpose: PermissionVO supports permission.ts by holding or executing the permission vo page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface PermissionVO { - id: IdType - permissionCode: string - permissionName: string - permissionGroup: string - description: string - createTime: string - updateTime: string -} - -/** - * Purpose: CreatePermissionRequest supports permission.ts by holding or executing the create permission request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface CreatePermissionRequest { - permissionCode: string - permissionName: string - permissionGroup: string - description: string -} - -/** - * Purpose: UpdatePermissionRequest supports permission.ts by holding or executing the update permission request page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface UpdatePermissionRequest { - permissionCode?: string - permissionName?: string - permissionGroup?: string - description?: string -} - -/** - * permissionApi groups all API calls for this page domain. - * Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script. - */ -export const permissionApi = { - /** - * `getUserPermissions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param userId?: IdType caller-supplied value for `userId?: IdType` - */ - getUserPermissions: (userId?: IdType) => { - if (userId) { - return adminApi.get(`/permission/user/${userId}`) - } - return adminApi.get('/permission/user/current') - }, - - /** - * `getAssignablePermissionIds` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param userId: IdType caller-supplied value for `userId: IdType` - */ - getAssignablePermissionIds: (userId: IdType) => { - return adminApi.get(`/permission/assignable/${userId}`) - }, - - /** - * `listAllPermissions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - */ - listAllPermissions: () => { - return adminApi.get('/permission/list/all') - }, - - /** - * `createPermission` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param data: CreatePermissionRequest caller-supplied value for `data: CreatePermissionRequest` - */ - createPermission: (data: CreatePermissionRequest) => { - return adminApi.post('/permission/create', data) - }, - - /** - * `updatePermission` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - * @param data: UpdatePermissionRequest caller-supplied value for `data: UpdatePermissionRequest` - */ - updatePermission: (id: IdType, data: UpdatePermissionRequest) => { - return adminApi.put(`/permission/update/${id}`, data) - }, - - /** - * `deletePermission` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param id: IdType caller-supplied value for `id: IdType` - */ - deletePermission: (id: IdType) => { - return adminApi.delete(`/permission/delete/${id}`) - }, - - /** - * `assignUserPermissions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature. - * Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller. - * @param userId: IdType caller-supplied value for `userId: IdType` - * @param permissionIds: IdType[] caller-supplied value for `permissionIds: IdType[]` - */ - assignUserPermissions: (userId: IdType, permissionIds: IdType[]) => { - return adminApi.post(`/permission/assign/${userId}`, { permissionIds }) - } -} diff --git a/FM-Frontend/src/components/admin/AdminFilterPanel.vue b/FM-Frontend/src/components/admin/AdminFilterPanel.vue deleted file mode 100644 index 2393b19a..00000000 --- a/FM-Frontend/src/components/admin/AdminFilterPanel.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/components/admin/AdminMobileCardList.vue b/FM-Frontend/src/components/admin/AdminMobileCardList.vue deleted file mode 100644 index f2d2b870..00000000 --- a/FM-Frontend/src/components/admin/AdminMobileCardList.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - diff --git a/FM-Frontend/src/components/admin/AdminMobileFab.vue b/FM-Frontend/src/components/admin/AdminMobileFab.vue deleted file mode 100644 index c4e0bca3..00000000 --- a/FM-Frontend/src/components/admin/AdminMobileFab.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/FM-Frontend/src/components/admin/AdminResponsiveModal.vue b/FM-Frontend/src/components/admin/AdminResponsiveModal.vue deleted file mode 100644 index e9a52e16..00000000 --- a/FM-Frontend/src/components/admin/AdminResponsiveModal.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - diff --git a/FM-Frontend/src/composables/useAdminViewport.ts b/FM-Frontend/src/composables/useAdminViewport.ts deleted file mode 100644 index de9d0bb7..00000000 --- a/FM-Frontend/src/composables/useAdminViewport.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { computed, onBeforeUnmount, onMounted, ref } from 'vue' - -/** - * Purpose: ADMIN_MOBILE_BREAKPOINT supports useAdminViewport.ts by holding or executing the admin mobile breakpoint page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const ADMIN_MOBILE_BREAKPOINT = 960 - -/** - * Purpose: viewportWidth supports useAdminViewport.ts by holding or executing the viewport width page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const viewportWidth = ref( - typeof window !== 'undefined' ? window.innerWidth : ADMIN_MOBILE_BREAKPOINT + 1 -) - -/** - * Purpose: listenerCount supports useAdminViewport.ts by holding or executing the listener count page or API role. - * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. - */ -let listenerCount = 0 - -/** - * Purpose: updateViewportWidth supports useAdminViewport.ts by holding or executing the update viewport width page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const updateViewportWidth = () => { - if (typeof window === 'undefined') { - return - } - viewportWidth.value = window.innerWidth -} - -/** - * Purpose: bindViewportListener supports useAdminViewport.ts by holding or executing the bind viewport listener page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const bindViewportListener = () => { - if (typeof window === 'undefined') { - return - } - if (listenerCount === 0) { - window.addEventListener('resize', updateViewportWidth, { passive: true }) - } - listenerCount += 1 -} - -/** - * Purpose: unbindViewportListener supports useAdminViewport.ts by holding or executing the unbind viewport listener page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const unbindViewportListener = () => { - if (typeof window === 'undefined') { - return - } - listenerCount = Math.max(0, listenerCount - 1) - if (listenerCount === 0) { - window.removeEventListener('resize', updateViewportWidth) - } -} - -/** - * Purpose: useAdminViewport supports useAdminViewport.ts by holding or executing the use admin viewport page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const useAdminViewport = () => { - onMounted(() => { - updateViewportWidth() - bindViewportListener() - }) - - onBeforeUnmount(() => { - unbindViewportListener() - }) - - return { - viewportWidth: computed(() => viewportWidth.value), - isMobile: computed(() => viewportWidth.value <= ADMIN_MOBILE_BREAKPOINT) - } -} diff --git a/FM-Frontend/src/config/admin-navigation.test.ts b/FM-Frontend/src/config/admin-navigation.test.ts deleted file mode 100644 index 15d62791..00000000 --- a/FM-Frontend/src/config/admin-navigation.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { adminNavigationItems, adminPermissionRouteMap, findAdminNavigationItemByPath, ADMIN_DASHBOARD_PATH } from './admin-navigation' - -describe('admin-navigation', () => { - it('keeps dashboard landing and permission routes aligned', () => { - expect(ADMIN_DASHBOARD_PATH).toBe('/admin/dashboard') - expect(findAdminNavigationItemByPath('/admin/products')?.label).toBe('作品管理') - expect(adminPermissionRouteMap.some(item => item.code === 'shop:view' && item.path === '/admin/shops')).toBe(true) - expect(adminNavigationItems[0]?.path).toBe('/admin') - }) -}) diff --git a/FM-Frontend/src/config/admin-navigation.ts b/FM-Frontend/src/config/admin-navigation.ts deleted file mode 100644 index e29e39d2..00000000 --- a/FM-Frontend/src/config/admin-navigation.ts +++ /dev/null @@ -1,56 +0,0 @@ -export type AdminNavIconKey = - | 'home' - | 'dashboard' - | 'user' - | 'shop' - | 'gift' - | 'message' - | 'security' - | 'tag' - | 'shopping' - | 'calendar' - | 'tool' - | 'team' - -export interface AdminNavigationItem { - path: string - iconKey: AdminNavIconKey - label: string - permissionCode: string -} - -export const ADMIN_HOME_PATH = '/admin' -export const ADMIN_DASHBOARD_PATH = '/admin/dashboard' - -export const adminNavigationItems: AdminNavigationItem[] = [ - { path: ADMIN_HOME_PATH, iconKey: 'home', label: '首页', permissionCode: '' }, - { path: ADMIN_DASHBOARD_PATH, iconKey: 'dashboard', label: '仪表盘', permissionCode: 'dashboard:view' }, - { path: '/admin/users', iconKey: 'user', label: '用户管理', permissionCode: 'user:view' }, - { path: '/admin/products', iconKey: 'shop', label: '作品管理', permissionCode: 'product:view' }, - { path: '/admin/coupons', iconKey: 'gift', label: '优惠券管理', permissionCode: 'coupon:view' }, - { path: '/admin/comments', iconKey: 'message', label: '评论管理', permissionCode: 'comment:view' }, - { path: '/admin/shops', iconKey: 'home', label: '店铺管理', permissionCode: 'shop:view' }, - { path: '/admin/permissions', iconKey: 'security', label: '权限管理', permissionCode: 'permission:view' }, - { path: '/admin/tags', iconKey: 'tag', label: '标签管理', permissionCode: 'tag:view' }, - { path: '/admin/orders', iconKey: 'shopping', label: '订单管理', permissionCode: 'order:view' }, - { path: '/admin/schedules', iconKey: 'calendar', label: '排班管理', permissionCode: 'schedule:view' }, - { path: '/admin/after-sales', iconKey: 'message', label: '售后处理', permissionCode: 'after_sale:view' }, - { path: '/admin/inventory', iconKey: 'tool', label: '库存管理', permissionCode: 'inventory:view' }, - { path: '/admin/campaigns', iconKey: 'gift', label: '活动管理', permissionCode: 'campaign:view' }, - { path: '/admin/nail-artists', iconKey: 'team', label: '美甲师管理', permissionCode: 'nail_artist:view' }, - { path: '/admin/messages', iconKey: 'message', label: '消息发布', permissionCode: 'message:view' }, - { path: '/admin/announcements', iconKey: 'message', label: '公告管理', permissionCode: 'announcement:view' }, - { path: '/admin/vip-recharge-plans', iconKey: 'gift', label: 'VIP充值配置', permissionCode: 'user:vip:manage' }, - { path: '/admin/messagehub-push-configs', iconKey: 'message', label: '参数管理', permissionCode: 'messagehub:config:manage' }, - { path: '/admin/legal-agreements', iconKey: 'security', label: '协议管理', permissionCode: 'legal_agreement:manage' } -] - -export const adminPermissionRouteMap = adminNavigationItems - .filter(item => item.permissionCode) - .map(item => ({ - code: item.permissionCode, - path: item.path - })) - -export const findAdminNavigationItemByPath = (path: string) => - adminNavigationItems.find(item => item.path === path) diff --git a/FM-Frontend/src/router/index.ts b/FM-Frontend/src/router/index.ts deleted file mode 100644 index 7443a1ad..00000000 --- a/FM-Frontend/src/router/index.ts +++ /dev/null @@ -1,371 +0,0 @@ -import { createRouter, createWebHistory } from 'vue-router' -import { - canAccessAdminRoute, - clearAdminBootstrapSession, - ensureAdminAuthBootstrap, - getAdminBootstrapSnapshot, - resolveAdminLandingPath, -} from '@/utils/admin-auth-bootstrap' - -/** - * Purpose: router supports index.ts by holding or executing the router page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const router = createRouter({ - history: createWebHistory(import.meta.env.BASE_URL), - routes: [ - { - path: '/', - name: 'auth', - component: () => import('../views/AuthView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/home', - name: 'home', - component: () => import('../views/HomeView.vue'), - meta: { requiresAuth: false, isAdmin: false } - }, - { - path: '/products', - name: 'products', - component: () => import('../views/ProductListView.vue'), - meta: { requiresAuth: false, isAdmin: false } - }, - { - path: '/product/:id', - name: 'product-detail', - component: () => import('../views/ProductDetailView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/cart', - name: 'cart', - component: () => import('../views/CartView.vue'), - meta: { requiresAuth: true, isAdmin: false } - }, - { - path: '/profile', - name: 'profile', - component: () => import('../views/ProfileView.vue'), - meta: { requiresAuth: true, isAdmin: false } - }, - { - path: '/shop/:id', - name: 'shop-detail', - component: () => import('../views/ShopDetailView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/shop/:shopId/artists', - name: 'shop-artists', - component: () => import('../views/ArtistListView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/artist/:id', - name: 'artist-profile', - component: () => import('../views/ArtistProfileView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/wishlist', - name: 'wishlist', - component: () => import('../views/WishlistView.vue'), - meta: { requiresAuth: true, isAdmin: false } - }, - { - path: '/orders', - name: 'orders', - component: () => import('../views/OrderView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/orders/:id', - name: 'order-detail', - component: () => import('../views/OrderDetailView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/after-sales', - name: 'after-sales', - component: () => import('../views/AfterSalesView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/after-sale/apply', - name: 'after-sale-apply', - component: () => import('../views/AfterSaleApplyView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/service-progress', - name: 'service-progress', - component: () => import('../views/ServiceProgressView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/help', - name: 'help', - component: () => import('../views/HelpView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - }, - { - path: '/artist-orders', - name: 'artist-orders', - component: () => import('../views/ArtistOrderView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false, permissionCode: 'order:view' } - }, - { - path: '/artist-calendar', - name: 'artist-calendar', - component: () => import('../views/ArtistCalendarView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false, permissionCode: 'order:view' } - }, - { - path: '/settings', - name: 'settings', - component: () => import('../views/SettingsView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/settings/account', - name: 'account-settings', - component: () => import('../views/AccountSettingsView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/settings/password', - name: 'password-settings', - component: () => import('../views/PasswordSettingsView.vue'), - meta: { requiresAuth: true, hideNav: true, isAdmin: false } - }, - { - path: '/coupons', - name: 'coupons', - component: () => import('../views/CouponView.vue'), - meta: { requiresAuth: true, isAdmin: false, hideNav: true } - }, - { - path: '/vip-center', - name: 'vip-center', - component: () => import('../views/VipCenterView.vue'), - meta: { requiresAuth: true, isAdmin: false, hideNav: true } - }, - { - path: '/notifications', - name: 'notifications', - component: () => import('../views/NotificationsView.vue'), - meta: { requiresAuth: true, isAdmin: false, hideNav: true } - }, - { - path: '/admin/login', - name: 'admin-login', - component: () => import('../views/admin/AdminLoginView.vue'), - meta: { requiresAuth: false, isAdmin: true, hideNav: true } - }, - { - path: '/admin', - component: () => import('../views/admin/AdminLayout.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true }, - children: [ - { - path: '', - name: 'admin', - component: () => import('../views/admin/HomeView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true } - }, - { - path: 'dashboard', - name: 'admin-dashboard', - component: () => import('../views/admin/DashboardView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'dashboard:view' } - }, - { - path: 'users', - name: 'admin-users', - component: () => import('../views/admin/UsersView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'user:view' } - }, - { - path: 'products', - name: 'admin-products', - component: () => import('../views/admin/ProductsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'product:view' } - }, - { - path: 'coupons', - name: 'admin-coupons', - component: () => import('../views/admin/CouponsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'coupon:view' } - }, - { - path: 'comments', - name: 'admin-comments', - component: () => import('../views/admin/CommentsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'comment:view' } - }, - { - path: 'shops', - name: 'admin-shops', - component: () => import('../views/admin/ShopsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'shop:view' } - }, - { - path: 'permissions', - name: 'admin-permissions', - component: () => import('../views/admin/PermissionsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'permission:view' } - }, - { - path: 'orders', - name: 'admin-orders', - component: () => import('../views/admin/OrdersView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'order:view' } - }, - { - path: 'schedules', - name: 'admin-schedules', - component: () => import('../views/admin/SchedulesView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'schedule:view' } - }, - { - path: 'after-sales', - name: 'admin-after-sales', - component: () => import('../views/admin/AfterSalesView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'after_sale:view' } - }, - { - path: 'inventory', - name: 'admin-inventory', - component: () => import('../views/admin/InventoryView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'inventory:view' } - }, - { - path: 'campaigns', - name: 'admin-campaigns', - component: () => import('../views/admin/CampaignsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'campaign:view' } - }, - { - path: 'manage', - name: 'admin-manage', - component: () => import('../views/admin/ManageView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true } - }, - { - path: 'profile', - name: 'admin-profile', - component: () => import('../views/admin/ProfileView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true } - }, - { - path: 'tags', - name: 'admin-tags', - component: () => import('../views/admin/TagsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'tag:view' } - }, - { - path: 'nail-artists', - name: 'admin-nail-artists', - component: () => import('../views/admin/NailArtistsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'nail_artist:view' } - }, - { - path: 'messages', - name: 'admin-messages', - component: () => import('../views/admin/SystemMessagesView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'message:view' } - }, - { - path: 'announcements', - name: 'admin-announcements', - component: () => import('../views/admin/AnnouncementsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'announcement:view' } - }, - { - path: 'vip-recharge-plans', - name: 'admin-vip-recharge-plans', - component: () => import('../views/admin/VipRechargePlansView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'user:vip:manage' } - }, - { - path: 'messagehub-push-configs', - name: 'admin-messagehub-push-configs', - component: () => import('../views/admin/MessageHubPushConfigsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'messagehub:config:manage' } - }, - { - path: 'legal-agreements', - name: 'admin-legal-agreements', - component: () => import('../views/admin/LegalAgreementsView.vue'), - meta: { requiresAuth: true, isAdmin: true, hideNav: true, permissionCode: 'legal_agreement:manage' } - } - ] - }, - { - path: '/:pathMatch(.*)*', - name: 'not-found', - component: () => import('../views/NotFoundView.vue'), - meta: { requiresAuth: false, hideNav: true, isAdmin: false } - } - ] -}) - -router.beforeEach(async (to) => { - const isAdminRoute = Boolean(to.meta.isAdmin) - const requiresAuth = Boolean(to.meta.requiresAuth) - - if (isAdminRoute) { - const snapshot = getAdminBootstrapSnapshot() - - if (to.path === '/admin/login') { - if (!snapshot.token || !snapshot.userInfo) { - return true - } - - const state = await ensureAdminAuthBootstrap() - return state === 'ready' ? resolveAdminLandingPath() : true - } - - if (requiresAuth && (!snapshot.token || !snapshot.userInfo)) { - clearAdminBootstrapSession() - return '/admin/login' - } - - const bootstrapState = await ensureAdminAuthBootstrap() - if (bootstrapState !== 'ready') { - return '/admin/login' - } - - if (!canAccessAdminRoute(to.path, to.meta.permissionCode as string | undefined)) { - return resolveAdminLandingPath() - } - - return true - } - - const token = localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken') - - if (requiresAuth && !token) { - return '/' - } - - if (to.path === '/' && token) { - return '/home' - } - - if (requiresAuth && token) { - const userInfo = localStorage.getItem('userInfo') - if (!userInfo) { - localStorage.removeItem('accessToken') - localStorage.removeItem('refreshToken') - sessionStorage.removeItem('accessToken') - return '/' - } - } - - return true -}) - -export default router diff --git a/FM-Frontend/src/styles/admin-mobile.css b/FM-Frontend/src/styles/admin-mobile.css deleted file mode 100644 index ac04f13b..00000000 --- a/FM-Frontend/src/styles/admin-mobile.css +++ /dev/null @@ -1,349 +0,0 @@ -:root { - --admin-mobile-ink: var(--text-primary); - --admin-mobile-surface: var(--theme-page-bg); - --admin-mobile-surface-alt: var(--theme-primary-soft); - --admin-mobile-card: var(--theme-card-bg); - --admin-mobile-border: var(--theme-border); - --admin-mobile-muted: var(--text-secondary); - --admin-mobile-accent: var(--theme-primary); - --admin-mobile-accent-strong: var(--theme-accent); - --admin-mobile-accent-soft: var(--theme-primary-soft); - --admin-mobile-shell-start: var(--theme-primary); - --admin-mobile-shell-mid: var(--theme-accent); - --admin-mobile-shell-end: color-mix(in srgb, var(--theme-accent) 78%, var(--text-primary)); - --admin-mobile-shell-glass: color-mix(in srgb, var(--theme-primary) 88%, transparent); - --admin-mobile-shell-soft: color-mix(in srgb, var(--theme-card-bg) 18%, transparent); - --admin-mobile-radius: 24px; - --admin-mobile-shadow: var(--theme-button-shadow); -} - -.admin-page-intro { - display: grid; - gap: 10px; - margin-bottom: 18px; - padding: 20px 18px; - color: var(--theme-card-bg); - background: - radial-gradient(circle at top right, color-mix(in srgb, var(--theme-card-bg) 20%, transparent), transparent 38%), - radial-gradient(circle at left top, color-mix(in srgb, var(--theme-secondary) 22%, transparent), transparent 42%), - linear-gradient( - 155deg, - var(--admin-mobile-shell-start) 0%, - var(--admin-mobile-shell-mid) 56%, - var(--admin-mobile-shell-end) 100% - ); - border-radius: 24px; - box-shadow: 0 18px 40px rgba(146, 103, 82, 0.2); -} - -.admin-page-intro__eyebrow { - font-size: 12px; - letter-spacing: 0.12em; - text-transform: uppercase; - color: rgba(255, 248, 241, 0.74); -} - -.admin-page-intro__title { - margin: 0; - font-size: clamp(20px, 4vw, 26px); - line-height: 1.08; - font-weight: 700; -} - -.admin-page-intro__subtitle { - margin: 0; - line-height: 1.65; - color: rgba(255, 248, 241, 0.82); -} - -.shops .admin-page-intro__subtitle, -.permissions .admin-page-intro__subtitle, -.orders .admin-page-intro__subtitle, -.nail-artists .admin-page-intro__subtitle { - display: none; -} - -.admin-page-intro__meta { - display: flex; - flex-wrap: wrap; - gap: 10px; -} - -.admin-page-chip { - display: inline-flex; - align-items: center; - gap: 6px; - min-height: 34px; - padding: 0 12px; - border-radius: 999px; - background: color-mix(in srgb, var(--theme-card-bg) 16%, transparent); - color: var(--theme-card-bg); - font-size: 13px; -} - -.admin-toolbar { - display: flex; - align-items: center; - justify-content: space-between; - gap: 12px; -} - -.admin-toolbar--stacked { - flex-direction: column; - align-items: stretch; -} - -.admin-toolbar__grow { - flex: 1; - min-width: 0; -} - -.admin-mobile-card-list { - display: grid; - gap: 14px; -} - -.admin-mobile-card { - padding: 16px; - background: var(--admin-mobile-card); - border: 1px solid var(--admin-mobile-border); - border-radius: 22px; - box-shadow: 0 12px 28px rgba(144, 103, 84, 0.09); -} - -.admin-mobile-card__cover { - width: 72px; - height: 72px; - border-radius: 18px; - object-fit: cover; - flex-shrink: 0; - background: var(--theme-primary-soft); -} - -.admin-mobile-card__cover--wide { - width: 100%; - height: 148px; - border-radius: 18px; -} - -.admin-mobile-card__head { - display: flex; - justify-content: space-between; - gap: 12px; -} - -.admin-mobile-card__head--media { - align-items: flex-start; -} - -.admin-mobile-card__body { - flex: 1; - min-width: 0; -} - -.admin-mobile-card__title { - font-size: 17px; - font-weight: 700; - line-height: 1.3; - color: var(--admin-mobile-ink); -} - -.admin-mobile-card__subtitle { - margin-top: 4px; - font-size: 13px; - color: var(--admin-mobile-muted); - line-height: 1.6; -} - -.admin-mobile-card__description { - margin-top: 10px; - color: var(--text-secondary); - line-height: 1.6; -} - -.admin-mobile-card__rows { - display: grid; - gap: 9px; - margin-top: 14px; -} - -.admin-mobile-card__row { - display: flex; - justify-content: space-between; - gap: 12px; - font-size: 13px; - color: var(--admin-mobile-muted); -} - -.admin-mobile-card__row span:first-child { - flex-shrink: 0; -} - -.admin-mobile-card__row strong, -.admin-mobile-card__row b { - min-width: 0; - color: var(--admin-mobile-ink); - font-weight: 600; - text-align: right; - word-break: normal; - overflow-wrap: break-word; -} - -.admin-mobile-card__actions { - display: flex; - flex-wrap: wrap; - gap: 8px; - margin-top: 16px; -} - -.admin-mobile-card__badge { - display: inline-flex; - align-items: center; - justify-content: center; - min-height: 30px; - padding: 0 12px; - border-radius: 999px; - background: var(--admin-mobile-accent-soft); - color: var(--theme-accent); - font-size: 12px; - font-weight: 600; - white-space: nowrap; -} - -.admin-mobile-grid { - display: grid; - gap: 14px; -} - -.admin-mobile-grid--two { - grid-template-columns: repeat(2, minmax(0, 1fr)); -} - -.admin-mobile-stat { - padding: 16px; - background: var(--admin-mobile-card); - border: 1px solid var(--admin-mobile-border); - border-radius: 20px; - box-shadow: 0 10px 24px rgba(144, 103, 84, 0.08); -} - -.admin-mobile-stat__label { - font-size: 12px; - color: var(--admin-mobile-muted); -} - -.admin-mobile-stat__value { - margin-top: 10px; - font-size: 24px; - font-weight: 700; - color: var(--admin-mobile-ink); -} - -.admin-mobile-section-card { - padding: 18px; - background: var(--admin-mobile-card); - border: 1px solid var(--admin-mobile-border); - border-radius: 22px; - box-shadow: 0 12px 28px rgba(144, 103, 84, 0.09); -} - -.admin-mobile-section-card__title { - font-size: 17px; - font-weight: 700; - color: var(--admin-mobile-ink); -} - -.admin-mobile-section-card__subtitle { - margin-top: 6px; - color: var(--admin-mobile-muted); - line-height: 1.65; -} - -.admin-mobile-modal .ant-modal { - top: 0 !important; - max-width: 100dvw !important; - width: 100dvw !important; - margin: 0; - padding-bottom: 0; -} - -.admin-mobile-modal .ant-modal-content { - min-height: 100vh; - border-radius: 0; - padding: 0; -} - -.admin-mobile-modal .ant-modal-header { - position: sticky; - top: 0; - z-index: 2; - padding: 18px 18px 14px; - background: var(--theme-card-bg); - border-bottom: 1px solid var(--admin-mobile-border); -} - -.admin-mobile-modal .ant-modal-title { - padding-right: 24px; - font-size: 18px; - font-weight: 700; - color: var(--admin-mobile-ink); -} - -.admin-mobile-modal .ant-modal-close { - top: 12px; - inset-inline-end: 12px; -} - -.admin-mobile-modal .ant-modal-body { - padding: 16px 16px 104px; -} - -.admin-mobile-modal .ant-modal-footer { - position: sticky; - bottom: 0; - z-index: 2; - display: flex; - justify-content: flex-end; - gap: 10px; - padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); - background: color-mix(in srgb, var(--theme-card-bg) 94%, transparent); - border-top: 1px solid var(--admin-mobile-border); - backdrop-filter: blur(14px); -} - -.admin-mobile-fab { - position: fixed; - right: 18px; - bottom: var(--admin-mobile-fab-bottom, calc(96px + env(safe-area-inset-bottom))); - z-index: 120; - width: 56px; - height: 56px; - display: inline-flex; - align-items: center; - justify-content: center; - border: 0; - border-radius: 999px; - background: var(--theme-gradient); - color: #ffffff; - box-shadow: var(--theme-button-shadow); -} - -.admin-mobile-fab .anticon { - font-size: 22px; -} - -@media (max-width: 960px) { - body { - background: var(--admin-mobile-surface); - } - - .admin-mobile-grid--two { - grid-template-columns: repeat(2, minmax(0, 1fr)); - } -} - -@media (max-width: 640px) { - .admin-mobile-grid--two { - grid-template-columns: 1fr; - } -} diff --git a/FM-Frontend/src/utils/admin-auth-bootstrap.ts b/FM-Frontend/src/utils/admin-auth-bootstrap.ts deleted file mode 100644 index 524b832d..00000000 --- a/FM-Frontend/src/utils/admin-auth-bootstrap.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { computed, ref } from 'vue' -import { - clearAdminSessionStorage, - getAdminAccessToken, - isBootstrapAdminUser, - loadCachedAdminUserInfo, -} from '@/utils/admin-session' -import { ADMIN_DASHBOARD_PATH, adminPermissionRouteMap } from '@/config/admin-navigation' -import { isAllowedForShoplessPlatformAdmin } from '@/utils/platform-admin-permissions' -import { - clearStoredPermissions, - fetchUserPermissionsStrict, - getStoredUserPermissions, -} from '@/utils/permission' - - -/** - * Purpose: AuthBootstrapState supports admin-auth-bootstrap.ts by holding or executing the auth bootstrap state page or API role. - * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. - */ -export type AuthBootstrapState = 'pending' | 'ready' | 'invalid' - -/** - * Purpose: adminBootstrapState supports admin-auth-bootstrap.ts by holding or executing the admin bootstrap state page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const adminBootstrapState = ref('pending') -let bootstrapPromise: Promise | null = null - - -/** - * Purpose: useAdminBootstrapState supports admin-auth-bootstrap.ts by holding or executing the use admin bootstrap state page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const useAdminBootstrapState = () => computed(() => adminBootstrapState.value) - -/** - * Purpose: invalidateAdminBootstrap supports admin-auth-bootstrap.ts by holding or executing the invalidate admin bootstrap page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const invalidateAdminBootstrap = () => { - adminBootstrapState.value = 'pending' - bootstrapPromise = null -} - -/** - * Purpose: clearAdminBootstrapSession supports admin-auth-bootstrap.ts by holding or executing the clear admin bootstrap session page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const clearAdminBootstrapSession = () => { - clearAdminSessionStorage() - clearStoredPermissions() - adminBootstrapState.value = 'invalid' - bootstrapPromise = null -} - -/** - * Purpose: getAdminBootstrapSnapshot supports admin-auth-bootstrap.ts by holding or executing the get admin bootstrap snapshot page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const getAdminBootstrapSnapshot = () => { - const userInfo = loadCachedAdminUserInfo() - return { - token: getAdminAccessToken(), - userInfo, - isBootstrapAdmin: isBootstrapAdminUser(userInfo), - isPlatformAdmin: Number(userInfo?.type) === 4, - permissions: getStoredUserPermissions() || [], - } -} - -/** - * Purpose: hasAdminPermission supports admin-auth-bootstrap.ts by holding or executing the has admin permission page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const hasAdminPermission = (permissionCode?: string) => { - if (!permissionCode) { - return true - } - - const snapshot = getAdminBootstrapSnapshot() - if (snapshot.isBootstrapAdmin || (snapshot.isPlatformAdmin && isAllowedForShoplessPlatformAdmin(permissionCode))) { - return isAllowedForShoplessPlatformAdmin(permissionCode) - } - - return snapshot.permissions.includes(permissionCode) -} - -/** - * Purpose: resolveAdminLandingPath supports admin-auth-bootstrap.ts by holding or executing the resolve admin landing path page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const resolveAdminLandingPath = () => { - const snapshot = getAdminBootstrapSnapshot() - if (snapshot.userInfo?.shopAuthorizationExpired && snapshot.userInfo?.type !== 4) { - return '/admin' - } - if (snapshot.isBootstrapAdmin) { - return ADMIN_DASHBOARD_PATH - } - - const matchedRoute = adminPermissionRouteMap.find(item => snapshot.permissions.includes(item.code)) - return matchedRoute?.path || '/admin' -} - -/** - * Purpose: canAccessAdminRoute supports admin-auth-bootstrap.ts by holding or executing the can access admin route page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const canAccessAdminRoute = (path: string, permissionCode?: string) => { - const snapshot = getAdminBootstrapSnapshot() - if (snapshot.userInfo?.shopAuthorizationExpired && snapshot.userInfo?.type !== 4) { - return path === '/admin' || path === '/admin/profile' - } - if (snapshot.isBootstrapAdmin) { - return hasAdminPermission(permissionCode) - } - - return hasAdminPermission(permissionCode) -} - -/** - * Purpose: ensureAdminAuthBootstrap supports admin-auth-bootstrap.ts by holding or executing the ensure admin auth bootstrap page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const ensureAdminAuthBootstrap = async (force = false): Promise => { - const snapshot = getAdminBootstrapSnapshot() - if (!snapshot.token || !snapshot.userInfo) { - clearAdminBootstrapSession() - return 'invalid' - } - - if (snapshot.isBootstrapAdmin) { - clearStoredPermissions() - adminBootstrapState.value = 'ready' - bootstrapPromise = null - return 'ready' - } - - const cachedPermissions = getStoredUserPermissions() - if (!force && cachedPermissions) { - adminBootstrapState.value = 'ready' - return 'ready' - } - - if (!force && bootstrapPromise) { - return bootstrapPromise - } - - adminBootstrapState.value = 'pending' - bootstrapPromise = (async () => { - try { - await fetchUserPermissionsStrict() - adminBootstrapState.value = 'ready' - return 'ready' as AuthBootstrapState - } catch (error) { - console.error('Failed to bootstrap admin permissions:', error) - clearAdminBootstrapSession() - return 'invalid' as AuthBootstrapState - } finally { - bootstrapPromise = null - } - })() - - return bootstrapPromise -} diff --git a/FM-Frontend/src/utils/admin-image-assets.test.ts b/FM-Frontend/src/utils/admin-image-assets.test.ts deleted file mode 100644 index 797c76e4..00000000 --- a/FM-Frontend/src/utils/admin-image-assets.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { - buildAdminUploadFileList, - buildSignedImageUrlMap, - getRecordImageUrls, - resolveSignedImageUrls -} from './admin-image-assets' - -vi.mock('@/utils/signed-image-cache', () => ({ - parseImageFileIds: (value?: string | null) => String(value || '').split(',').map(id => id.trim()).filter(Boolean), - getCachedSignedImageUrl: async (fileId: string | number | null | undefined, fallback = '') => - fileId ? `signed-${fileId}` : fallback, - getCachedSignedImageUrls: async (fileIds: Array, fallback = '') => { - const urls = fileIds.filter(Boolean).map(fileId => `signed-${fileId}`) - return urls.length ? urls : (fallback ? [fallback] : []) - } -})) - -describe('admin-image-assets', () => { - it('resolves comma separated image ids with fallback policy', async () => { - await expect(resolveSignedImageUrls('1, 2,,3', 'fallback.png', true)).resolves.toEqual([ - 'signed-1', - 'signed-2', - 'signed-3' - ]) - await expect(resolveSignedImageUrls('', 'fallback.png', true)).resolves.toEqual(['fallback.png']) - await expect(resolveSignedImageUrls('', 'fallback.png', false)).resolves.toEqual([]) - }) - - it('builds image url maps and respects cancellation', async () => { - await expect(buildSignedImageUrlMap( - [{ id: 7, imageFileIds: '10,11' }], - 'imageFileIds', - 'fallback.png', - true, - () => false - )).resolves.toEqual({ 7: ['signed-10', 'signed-11'] }) - - await expect(buildSignedImageUrlMap( - [{ id: 7, imageFileIds: '10,11' }], - 'imageFileIds', - 'fallback.png', - true, - () => true - )).resolves.toBeNull() - }) - - it('returns mapped record images or fallback images', () => { - expect(getRecordImageUrls({ id: 1 }, { 1: ['a.png'] }, ['fallback.png'])).toEqual(['a.png']) - expect(getRecordImageUrls({ id: 2 }, { 1: ['a.png'] }, ['fallback.png'])).toEqual(['fallback.png']) - }) - - it('builds upload file list from ids', async () => { - await expect(buildAdminUploadFileList(['8', ' 9 '], '图片', 'fallback.png')).resolves.toEqual([ - { uid: '8', fileId: '8', name: '图片1', status: 'done', url: 'signed-8' }, - { uid: '9', fileId: '9', name: '图片2', status: 'done', url: 'signed-9' } - ]) - }) -}) diff --git a/FM-Frontend/src/utils/admin-image-assets.ts b/FM-Frontend/src/utils/admin-image-assets.ts deleted file mode 100644 index 7d92bf09..00000000 --- a/FM-Frontend/src/utils/admin-image-assets.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { - getCachedSignedImageUrl, - getCachedSignedImageUrls, - parseImageFileIds, - refreshCachedSignedImageUrl -} from '@/utils/signed-image-cache' -import type { IdType } from '@/utils/id' - -export interface AdminUploadFileItem { - uid: string - fileId: string - name: string - status: 'done' - url: string -} - -export type SignedImageRecord = { - id?: IdType - imageFileIds?: string - coverImageFileId?: string -} - -export type ImageFieldName = 'imageFileIds' | 'coverImageFileId' - -export const resolveSignedImageUrl = async ( - fileId: IdType | null | undefined, - fallback: string -): Promise => getCachedSignedImageUrl(fileId, fallback, 'admin') - -export const refreshSignedImageUrl = async ( - fileId: IdType | null | undefined, - fallback: string -): Promise => refreshCachedSignedImageUrl(fileId, fallback, 'admin') - -export const resolveSignedImageUrls = async ( - fileIdsValue: string | null | undefined, - fallback: string, - emptyFallback: boolean -): Promise => { - const fileIds = parseImageFileIds(fileIdsValue) - if (!fileIds.length) { - return emptyFallback ? [fallback] : [] - } - return getCachedSignedImageUrls(fileIds, fallback, 'admin') -} - -export const buildSignedImageUrlMap = async ( - records: TRecord[], - fieldName: ImageFieldName, - fallback: string, - emptyFallback: boolean, - isCancelled: () => boolean -): Promise | null> => { - const nextImageUrls: Record = {} - - for (const record of records) { - if (isCancelled()) { - return null - } - if (record.id === undefined || record.id === null) { - continue - } - - nextImageUrls[String(record.id)] = await resolveSignedImageUrls(record[fieldName], fallback, emptyFallback) - } - - return nextImageUrls -} - -export const getRecordImageUrls = ( - record: TRecord, - imageUrlMap: Record, - fallbackImages: string[] -): string[] => { - if (record.id === undefined || record.id === null) { - return fallbackImages - } - return imageUrlMap[String(record.id)] || fallbackImages -} - -export const buildAdminUploadFileList = async ( - fileIds: string[], - fileNamePrefix: string, - fallback: string -): Promise => { - const fileList: AdminUploadFileItem[] = [] - - for (const [index, fileId] of fileIds.entries()) { - const normalizedFileId = fileId.trim() - if (!normalizedFileId) { - continue - } - const url = await resolveSignedImageUrl(normalizedFileId, fallback) - fileList.push({ - uid: normalizedFileId, - fileId: normalizedFileId, - name: `${fileNamePrefix}${index + 1}`, - status: 'done', - url - }) - } - - return fileList -} diff --git a/FM-Frontend/src/utils/admin-session.ts b/FM-Frontend/src/utils/admin-session.ts deleted file mode 100644 index 58b7285a..00000000 --- a/FM-Frontend/src/utils/admin-session.ts +++ /dev/null @@ -1,78 +0,0 @@ -import type { IdType } from '@/utils/id' - -/** - * Purpose: AdminCachedUserInfo supports admin-session.ts by holding or executing the admin cached user info page or API role. - * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. - */ -export interface AdminCachedUserInfo { - id?: IdType - type?: number - account?: string - nickname?: string - avatar?: string - shopId?: IdType - shopName?: string - shopAuthorizationExpireTime?: string - shopAuthorizationExpired?: boolean - shopIds?: IdType[] - shopNames?: string[] -} - -/** - * Purpose: getAdminAccessToken supports admin-session.ts by holding or executing the get admin access token page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const getAdminAccessToken = () => - localStorage.getItem('adminAccessToken') || sessionStorage.getItem('adminAccessToken') - -/** - * Purpose: getAdminRefreshToken supports admin-session.ts by holding or executing the get admin refresh token page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const getAdminRefreshToken = () => - localStorage.getItem('adminRefreshToken') || sessionStorage.getItem('adminRefreshToken') - -/** - * Purpose: loadCachedAdminUserInfo supports admin-session.ts by holding or executing the load cached admin user info page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const loadCachedAdminUserInfo = (): AdminCachedUserInfo | null => { - const raw = localStorage.getItem('adminUserInfo') - if (!raw) { - return null - } - - try { - return JSON.parse(raw) as AdminCachedUserInfo - } catch (error) { - console.error('Failed to parse cached admin user info:', error) - localStorage.removeItem('adminUserInfo') - return null - } -} - -/** - * Purpose: isBootstrapAdminUser supports admin-session.ts by holding or executing the is bootstrap admin user page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const isBootstrapAdminUser = (userInfo?: AdminCachedUserInfo | null) => - userInfo?.type === 4 && !userInfo?.shopId - -/** - * Purpose: isPlatformOverviewAdminUser supports admin-session.ts by holding or executing the is platform overview admin user page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const isPlatformOverviewAdminUser = isBootstrapAdminUser - -/** - * Purpose: clearAdminSessionStorage supports admin-session.ts by holding or executing the clear admin session storage page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const clearAdminSessionStorage = () => { - localStorage.removeItem('adminAccessToken') - localStorage.removeItem('adminRefreshToken') - localStorage.removeItem('adminUserInfo') - localStorage.removeItem('userPermissions') - sessionStorage.removeItem('adminAccessToken') - sessionStorage.removeItem('adminRefreshToken') -} diff --git a/FM-Frontend/src/utils/admin-table.test.ts b/FM-Frontend/src/utils/admin-table.test.ts deleted file mode 100644 index 380a01eb..00000000 --- a/FM-Frontend/src/utils/admin-table.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { applyAdminTablePaginationChange, createAdminPagination } from './admin-table' - -describe('admin-table', () => { - it('creates default pagination state', () => { - expect(createAdminPagination().current).toBe(1) - expect(createAdminPagination().pageSize).toBe(10) - }) - - it('applies pagination changes', () => { - const pagination = createAdminPagination() - const nextPagination = applyAdminTablePaginationChange(pagination, { current: 3, pageSize: 20 }) - expect(nextPagination.current).toBe(3) - expect(nextPagination.pageSize).toBe(20) - expect(pagination.current).toBe(1) - }) -}) diff --git a/FM-Frontend/src/utils/admin-table.ts b/FM-Frontend/src/utils/admin-table.ts deleted file mode 100644 index 1bee7309..00000000 --- a/FM-Frontend/src/utils/admin-table.ts +++ /dev/null @@ -1,35 +0,0 @@ -export interface AdminPaginationState { - current: number - pageSize: number - total: number - showSizeChanger: boolean - showQuickJumper: boolean - showTotal: (total: number) => string -} - -export interface AdminTablePaginationChange { - current?: number - pageSize?: number -} - -export interface AdminPaginationPageChange { - current: number - pageSize: number -} - -export const createAdminPagination = (): AdminPaginationState => ({ - current: 1, - pageSize: 10, - total: 0, - showSizeChanger: true, - showQuickJumper: true, - showTotal: (total: number) => `共 ${total} 条` -}) - -export const applyAdminTablePaginationChange = ( - pagination: AdminPaginationState, - change: AdminTablePaginationChange -): AdminPaginationPageChange => ({ - current: change.current || pagination.current, - pageSize: change.pageSize || pagination.pageSize -}) diff --git a/FM-Frontend/src/utils/admin-upload-file.test.ts b/FM-Frontend/src/utils/admin-upload-file.test.ts deleted file mode 100644 index 7e0615e3..00000000 --- a/FM-Frontend/src/utils/admin-upload-file.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { getUploadResponse, resolveUploadedFileId } from './admin-upload-file' - -describe('admin-upload-file', () => { - it('resolves uploaded file id from response or file shape', () => { - expect(resolveUploadedFileId({ response: { id: 7 } })).toBe('7') - expect(resolveUploadedFileId({ fileId: '8' })).toBe('8') - expect(resolveUploadedFileId({ uid: '9' })).toBe('9') - expect(getUploadResponse(null)).toBeNull() - }) -}) diff --git a/FM-Frontend/src/utils/admin-upload-file.ts b/FM-Frontend/src/utils/admin-upload-file.ts deleted file mode 100644 index 8c00fe4f..00000000 --- a/FM-Frontend/src/utils/admin-upload-file.ts +++ /dev/null @@ -1,49 +0,0 @@ -export interface AdminUploadResponseData { - id?: string | number - fileId?: string | number -} - -export interface AdminUploadResponse { - id?: string | number - fileId?: string | number - data?: AdminUploadResponseData -} - -export interface AdminUploadFileLike { - uid?: string | number - url?: string - thumbUrl?: string - fileId?: string | number - response?: AdminUploadResponse -} - -export interface AdminUploadTaskFile extends File { - uid: string -} - -export const getUploadResponse = (file: AdminUploadFileLike | null | undefined): AdminUploadResponse | null => { - if (!file || typeof file !== 'object') { - return null - } - return file.response || null -} - -export const resolveUploadedFileId = (file: AdminUploadFileLike | null | undefined): string => { - const response = getUploadResponse(file) - const responseId = response?.id ?? response?.data?.id ?? response?.fileId ?? response?.data?.fileId ?? file?.fileId - if (responseId !== undefined && responseId !== null && responseId !== '') { - return String(responseId) - } - - const fileUid = String(file?.uid || '') - if (/^\d+$/.test(fileUid)) { - return fileUid - } - - const fileUrl = String(file?.url || '') - if (/^\d+$/.test(fileUrl)) { - return fileUrl - } - - return '' -} diff --git a/FM-Frontend/src/utils/permission.ts b/FM-Frontend/src/utils/permission.ts deleted file mode 100644 index afdc5b26..00000000 --- a/FM-Frontend/src/utils/permission.ts +++ /dev/null @@ -1,150 +0,0 @@ -import { permissionApi } from '@/api/permission' -import { computed, ref } from 'vue' -import { isBootstrapAdminUser, loadCachedAdminUserInfo } from '@/utils/admin-session' -import { isAllowedForShoplessPlatformAdmin } from '@/utils/platform-admin-permissions' - -/** - * Purpose: USER_PERMISSIONS_STORAGE_KEY supports permission.ts by holding or executing the user permissions storage key page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const USER_PERMISSIONS_STORAGE_KEY = 'userPermissions' - -/** - * Purpose: readPermissionsFromStorage supports permission.ts by holding or executing the read permissions from storage page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const readPermissionsFromStorage = () => { - const raw = localStorage.getItem(USER_PERMISSIONS_STORAGE_KEY) - if (!raw) { - return null - } - - try { - const parsed = JSON.parse(raw) - return Array.isArray(parsed) ? parsed.map(item => String(item)) : null - } catch (error) { - console.error('Failed to parse stored user permissions:', error) - localStorage.removeItem(USER_PERMISSIONS_STORAGE_KEY) - return null - } -} - -/** - * Purpose: userPermissions supports permission.ts by holding or executing the user permissions page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const userPermissions = ref(readPermissionsFromStorage() || []) -/** - * Purpose: loadingPermissions supports permission.ts by holding or executing the loading permissions page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const loadingPermissions = ref(false) - -/** - * Purpose: isPlatformAdminUser supports permission.ts by holding or executing the is platform admin user page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const isPlatformAdminUser = () => Number(loadCachedAdminUserInfo()?.type) === 4 - -/** - * Purpose: getStoredUserPermissions supports permission.ts by holding or executing the get stored user permissions page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const getStoredUserPermissions = () => readPermissionsFromStorage() - -/** - * Purpose: setStoredUserPermissions supports permission.ts by holding or executing the set stored user permissions page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const setStoredUserPermissions = (permissions: string[]) => { - userPermissions.value = Array.from(new Set((permissions || []).map(code => String(code)))) - localStorage.setItem(USER_PERMISSIONS_STORAGE_KEY, JSON.stringify(userPermissions.value)) - return userPermissions.value -} - -/** - * Purpose: clearStoredPermissions supports permission.ts by holding or executing the clear stored permissions page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const clearStoredPermissions = () => { - userPermissions.value = [] - localStorage.removeItem(USER_PERMISSIONS_STORAGE_KEY) -} - -/** - * Purpose: fetchUserPermissionsStrict supports permission.ts by holding or executing the fetch user permissions strict page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const fetchUserPermissionsStrict = async () => { - loadingPermissions.value = true - try { - const permissions = await permissionApi.getUserPermissions() - const normalizedPermissions = permissions && Array.isArray(permissions) - ? permissions.map(permission => permission.permissionCode) - : [] - - return setStoredUserPermissions(normalizedPermissions) - } finally { - loadingPermissions.value = false - } -} - -/** - * Purpose: usePermission supports permission.ts by holding or executing the use permission page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const usePermission = () => { - const hasPermission = (permissionCode: string) => { - if (isBootstrapAdminUser(loadCachedAdminUserInfo())) { - return isAllowedForShoplessPlatformAdmin(permissionCode) - } - if (isPlatformAdminUser() && isAllowedForShoplessPlatformAdmin(permissionCode)) { - return isAllowedForShoplessPlatformAdmin(permissionCode) - } - return userPermissions.value.includes(permissionCode) - } - - const hasAnyPermission = (permissionCodes: string[]) => { - if (isBootstrapAdminUser(loadCachedAdminUserInfo())) { - return permissionCodes.some(isAllowedForShoplessPlatformAdmin) - } - if (isPlatformAdminUser() && permissionCodes.some(isAllowedForShoplessPlatformAdmin)) { - return permissionCodes.some(isAllowedForShoplessPlatformAdmin) - } - return permissionCodes.some(code => userPermissions.value.includes(code)) - } - - const hasAllPermissions = (permissionCodes: string[]) => { - if (isBootstrapAdminUser(loadCachedAdminUserInfo())) { - return permissionCodes.every(isAllowedForShoplessPlatformAdmin) - } - if (isPlatformAdminUser() && permissionCodes.every(isAllowedForShoplessPlatformAdmin)) { - return permissionCodes.every(isAllowedForShoplessPlatformAdmin) - } - return permissionCodes.every(code => userPermissions.value.includes(code)) - } - - const loadUserPermissions = async () => { - try { - return await fetchUserPermissionsStrict() - } catch (error) { - console.error('加载用户权限失败:', error) - clearStoredPermissions() - return [] - } - } - - const clearPermissions = () => { - clearStoredPermissions() - } - - return { - userPermissions: computed(() => userPermissions.value), - loadingPermissions: computed(() => loadingPermissions.value), - hasPermission, - hasAnyPermission, - hasAllPermissions, - loadUserPermissions, - clearPermissions - } -} diff --git a/FM-Frontend/src/utils/platform-admin-permissions.ts b/FM-Frontend/src/utils/platform-admin-permissions.ts deleted file mode 100644 index 1c40db11..00000000 --- a/FM-Frontend/src/utils/platform-admin-permissions.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Purpose: SHOPLESS_ADMIN_ALLOWED_PREFIXES supports platform-admin-permissions.ts by holding or executing the shopless admin allowed prefixes page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const SHOPLESS_ADMIN_ALLOWED_PREFIXES = ['user:', 'shop:', 'permission:', 'message:', 'announcement:'] -/** - * Purpose: SHOPLESS_ADMIN_ALLOWED_PERMISSIONS supports platform-admin-permissions.ts by holding or executing the shopless admin allowed permissions page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -const SHOPLESS_ADMIN_ALLOWED_PERMISSIONS = [ - 'messagehub:config:manage', - 'security:audit:view', - 'legal_agreement:manage' -] - -/** - * Purpose: isAllowedForShoplessPlatformAdmin supports platform-admin-permissions.ts by holding or executing the is allowed for shopless platform admin page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const isAllowedForShoplessPlatformAdmin = (permissionCode: string) => - permissionCode === 'dashboard:view' - || permissionCode.endsWith(':view') - || SHOPLESS_ADMIN_ALLOWED_PERMISSIONS.includes(permissionCode) - || SHOPLESS_ADMIN_ALLOWED_PREFIXES.some(prefix => permissionCode.startsWith(prefix)) diff --git a/FM-Frontend/src/utils/signed-image-cache.test.ts b/FM-Frontend/src/utils/signed-image-cache.test.ts deleted file mode 100644 index 57fb2a8e..00000000 --- a/FM-Frontend/src/utils/signed-image-cache.test.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' - -const publicGetSignedUrl = vi.fn() -const adminGetSignedUrl = vi.fn() - -vi.mock('@/api/file', () => ({ - fileApi: { - getSignedUrl: publicGetSignedUrl - } -})) - -vi.mock('@/api/admin', () => ({ - adminFileApi: { - getSignedUrl: adminGetSignedUrl - } -})) - -describe('signed-image-cache', () => { - beforeEach(() => { - vi.resetModules() - vi.clearAllMocks() - publicGetSignedUrl.mockResolvedValue({ data: 'https://public.test/image.jpg' }) - adminGetSignedUrl.mockResolvedValue('https://admin.test/image.jpg') - }) - - it('keeps public and admin signed url cache entries isolated', async () => { - const { getCachedSignedImageUrl, getCachedSignedImageUrlSync } = await import('./signed-image-cache') - - await expect(getCachedSignedImageUrl('42', '', 'public')).resolves.toBe('https://public.test/image.jpg') - await expect(getCachedSignedImageUrl('42', '', 'admin')).resolves.toBe('https://admin.test/image.jpg') - - expect(publicGetSignedUrl).toHaveBeenCalledTimes(1) - expect(adminGetSignedUrl).toHaveBeenCalledTimes(1) - expect(getCachedSignedImageUrlSync('42', 'public')).toBe('https://public.test/image.jpg') - expect(getCachedSignedImageUrlSync('42', 'admin')).toBe('https://admin.test/image.jpg') - }) - - it('uses fallback when file id is empty or signing fails', async () => { - const { getCachedSignedImageUrl } = await import('./signed-image-cache') - - await expect(getCachedSignedImageUrl('', 'fallback.png', 'public')).resolves.toBe('fallback.png') - publicGetSignedUrl.mockRejectedValueOnce(new Error('sign failed')) - await expect(getCachedSignedImageUrl('99', 'fallback.png', 'public')).resolves.toBe('fallback.png') - }) - - it('normalizes signed image urls without scheme', async () => { - const { getCachedSignedImageUrl, getCachedSignedImageUrlSync } = await import('./signed-image-cache') - - adminGetSignedUrl.mockResolvedValueOnce('img.yunail.art/325517220106911744.jpg?e=1&token=test') - - await expect(getCachedSignedImageUrl('325517232303947776', '', 'admin')).resolves.toBe( - 'http://img.yunail.art/325517220106911744.jpg?e=1&token=test' - ) - expect(getCachedSignedImageUrlSync('325517232303947776', 'admin')).toBe( - 'http://img.yunail.art/325517220106911744.jpg?e=1&token=test' - ) - }) - - it('refreshes a cached signed image url after clearing the old entry', async () => { - const { getCachedSignedImageUrl, refreshCachedSignedImageUrl } = await import('./signed-image-cache') - - adminGetSignedUrl - .mockResolvedValueOnce('https://admin.test/old.jpg') - .mockResolvedValueOnce('https://admin.test/new.jpg') - - await expect(getCachedSignedImageUrl('42', '', 'admin')).resolves.toBe('https://admin.test/old.jpg') - await expect(refreshCachedSignedImageUrl('42', '', 'admin')).resolves.toBe('https://admin.test/new.jpg') - expect(adminGetSignedUrl).toHaveBeenCalledTimes(2) - }) -}) diff --git a/FM-Frontend/src/views/ArtistCalendarView.vue b/FM-Frontend/src/views/ArtistCalendarView.vue deleted file mode 100644 index 386ef997..00000000 --- a/FM-Frontend/src/views/ArtistCalendarView.vue +++ /dev/null @@ -1,288 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/ArtistOrderView.vue b/FM-Frontend/src/views/ArtistOrderView.vue deleted file mode 100644 index d78c4289..00000000 --- a/FM-Frontend/src/views/ArtistOrderView.vue +++ /dev/null @@ -1,748 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/AdminLayout.vue b/FM-Frontend/src/views/admin/AdminLayout.vue deleted file mode 100644 index ff9c3e64..00000000 --- a/FM-Frontend/src/views/admin/AdminLayout.vue +++ /dev/null @@ -1,1196 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/AfterSalesView.vue b/FM-Frontend/src/views/admin/AfterSalesView.vue deleted file mode 100644 index 2b9ead61..00000000 --- a/FM-Frontend/src/views/admin/AfterSalesView.vue +++ /dev/null @@ -1,295 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/AnnouncementsView.vue b/FM-Frontend/src/views/admin/AnnouncementsView.vue deleted file mode 100644 index 45cf77d4..00000000 --- a/FM-Frontend/src/views/admin/AnnouncementsView.vue +++ /dev/null @@ -1,216 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/CampaignsView.vue b/FM-Frontend/src/views/admin/CampaignsView.vue deleted file mode 100644 index 201f2944..00000000 --- a/FM-Frontend/src/views/admin/CampaignsView.vue +++ /dev/null @@ -1,312 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/CommentsView.vue b/FM-Frontend/src/views/admin/CommentsView.vue deleted file mode 100644 index b47887df..00000000 --- a/FM-Frontend/src/views/admin/CommentsView.vue +++ /dev/null @@ -1,245 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/CouponsView.vue b/FM-Frontend/src/views/admin/CouponsView.vue deleted file mode 100644 index dcda0898..00000000 --- a/FM-Frontend/src/views/admin/CouponsView.vue +++ /dev/null @@ -1,987 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/DashboardView.vue b/FM-Frontend/src/views/admin/DashboardView.vue deleted file mode 100644 index e8130901..00000000 --- a/FM-Frontend/src/views/admin/DashboardView.vue +++ /dev/null @@ -1,1088 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/HomeView.vue b/FM-Frontend/src/views/admin/HomeView.vue deleted file mode 100644 index e045f490..00000000 --- a/FM-Frontend/src/views/admin/HomeView.vue +++ /dev/null @@ -1,583 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/InventoryView.vue b/FM-Frontend/src/views/admin/InventoryView.vue deleted file mode 100644 index 428a3554..00000000 --- a/FM-Frontend/src/views/admin/InventoryView.vue +++ /dev/null @@ -1,344 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/LegalAgreementsView.vue b/FM-Frontend/src/views/admin/LegalAgreementsView.vue deleted file mode 100644 index 1dedd5e1..00000000 --- a/FM-Frontend/src/views/admin/LegalAgreementsView.vue +++ /dev/null @@ -1,215 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/ManageView.vue b/FM-Frontend/src/views/admin/ManageView.vue deleted file mode 100644 index f8f76ecf..00000000 --- a/FM-Frontend/src/views/admin/ManageView.vue +++ /dev/null @@ -1,405 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/MessageHubPushConfigsView.vue b/FM-Frontend/src/views/admin/MessageHubPushConfigsView.vue deleted file mode 100644 index 5efeb287..00000000 --- a/FM-Frontend/src/views/admin/MessageHubPushConfigsView.vue +++ /dev/null @@ -1,480 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/OrdersView.vue b/FM-Frontend/src/views/admin/OrdersView.vue deleted file mode 100644 index b510ea02..00000000 --- a/FM-Frontend/src/views/admin/OrdersView.vue +++ /dev/null @@ -1,1053 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/ProfileView.vue b/FM-Frontend/src/views/admin/ProfileView.vue deleted file mode 100644 index 0a87cdcb..00000000 --- a/FM-Frontend/src/views/admin/ProfileView.vue +++ /dev/null @@ -1,260 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/SchedulesView.vue b/FM-Frontend/src/views/admin/SchedulesView.vue deleted file mode 100644 index c47cbcf2..00000000 --- a/FM-Frontend/src/views/admin/SchedulesView.vue +++ /dev/null @@ -1,309 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/SystemMessagesView.vue b/FM-Frontend/src/views/admin/SystemMessagesView.vue deleted file mode 100644 index 64414ea3..00000000 --- a/FM-Frontend/src/views/admin/SystemMessagesView.vue +++ /dev/null @@ -1,742 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/UsersView.vue b/FM-Frontend/src/views/admin/UsersView.vue deleted file mode 100644 index d46416ca..00000000 --- a/FM-Frontend/src/views/admin/UsersView.vue +++ /dev/null @@ -1,1978 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/VipRechargePlansView.vue b/FM-Frontend/src/views/admin/VipRechargePlansView.vue deleted file mode 100644 index f7bebe30..00000000 --- a/FM-Frontend/src/views/admin/VipRechargePlansView.vue +++ /dev/null @@ -1,189 +0,0 @@ - - - - - diff --git a/FM-Frontend/src/views/admin/admin-helpers.ts b/FM-Frontend/src/views/admin/admin-helpers.ts deleted file mode 100644 index 2e5c2b57..00000000 --- a/FM-Frontend/src/views/admin/admin-helpers.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Purpose: AdminCachedUserInfo supports admin-helpers.ts by holding or executing the admin cached user info page or API role. - * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. - */ -import { loadCachedAdminUserInfo, isBootstrapAdminUser, type AdminCachedUserInfo } from '@/utils/admin-session' - -export { loadCachedAdminUserInfo, isBootstrapAdminUser } -export type { AdminCachedUserInfo } - -/** - * Purpose: getAdminRoleLabel supports admin-helpers.ts by holding or executing the get admin role label page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const getAdminRoleLabel = (type?: number) => { - switch (type) { - case 4: - return '平台管理员' - case 2: - return '店长' - case 3: - return '美甲师' - default: - return '后台账号' - } -} - -/** - * Purpose: getAdminShopOptions supports admin-helpers.ts by holding or executing the get admin shop options page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const getAdminShopOptions = (userInfo?: AdminCachedUserInfo | null) => { - const ids = userInfo?.shopIds || [] - const names = userInfo?.shopNames || [] - return ids.map((id, index) => ({ - id: String(id), - name: names[index] || `门店 ${id}` - })) -} - -/** - * Purpose: getAdminCurrentShopName supports admin-helpers.ts by holding or executing the get admin current shop name page or API role. - * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. - */ -export const getAdminCurrentShopName = (userInfo?: AdminCachedUserInfo | null) => - userInfo?.shopName || (isBootstrapAdminUser(userInfo) ? '平台总览模式' : '游客模式') diff --git a/FM-Frontend/src/views/admin/admin-modal-user-form.test.ts b/FM-Frontend/src/views/admin/admin-modal-user-form.test.ts deleted file mode 100644 index 6082d794..00000000 --- a/FM-Frontend/src/views/admin/admin-modal-user-form.test.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readFileSync, readdirSync } from 'node:fs' -import { join } from 'node:path' - -const sourceRoot = join(process.cwd(), 'src') -const adminViewsPath = join(sourceRoot, 'views', 'admin') - -function readSource(relativePath: string) { - return readFileSync(join(sourceRoot, relativePath), 'utf-8') -} - -function findModalTags(source: string) { - return Array.from(source.matchAll(//g), match => match[0]) -} - -function findUserFormModal(source: string) { - const match = source.match(//) - return match?.[0] ?? '' -} - -function findFormItem(source: string, name: string) { - const match = source.match(new RegExp(``)) - return match?.[0] ?? '' -} - -describe('admin modal and user form behavior', () => { - it('keeps every backend modal open when users click the blank mask area', () => { - const responsiveModal = readSource('components/admin/AdminResponsiveModal.vue') - expect(responsiveModal).toMatch(/ fileName.endsWith('.vue')) - .flatMap(fileName => { - const source = readFileSync(join(adminViewsPath, fileName), 'utf-8') - return findModalTags(source) - .map((tag, index) => ({ fileName, index: index + 1, tag })) - .filter(({ tag }) => !/:mask-closable\s*=\s*"false"/.test(tag)) - .map(({ fileName, index }) => `${fileName} modal #${index}`) - }) - - expect(missingMaskLock).toEqual([]) - }) - - it('shows only one editable phone field in the user create and edit form', () => { - const usersView = readSource('views/admin/UsersView.vue') - const userFormModal = findUserFormModal(usersView) - - expect(userFormModal).toContain('name="phone"') - expect(userFormModal).not.toContain('name="contactPhone"') - expect(userFormModal).not.toContain('formState.contactPhone') - expect(usersView).toContain('const primaryPhone = formState.phone.trim()') - expect(usersView).toContain('phone: primaryPhone') - expect(usersView).toContain('contactPhone: primaryPhone') - }) - - it('uses a polished date picker and visible required markers for conditional user fields', () => { - const usersView = readSource('views/admin/UsersView.vue') - const userFormModal = findUserFormModal(usersView) - const wechatIdField = findFormItem(userFormModal, 'wechatId') - const shopIdsField = findFormItem(userFormModal, 'shopIds') - - expect(userFormModal).not.toContain('type="date"') - expect(userFormModal).toContain('/g), match => match[0]) -} - -describe('admin table layout', () => { - it('keeps every admin table wide enough to scroll horizontally', () => { - const missingScrollX = readdirSync(adminViewsPath) - .filter(fileName => fileName.endsWith('.vue')) - .flatMap(fileName => { - const source = readFileSync(join(adminViewsPath, fileName), 'utf-8') - return findTableTags(source) - .map((tag, index) => ({ fileName, index: index + 1, tag })) - .filter(({ tag }) => !/:scroll\s*=\s*"\{[\s\S]*x:\s*'max-content'/.test(tag)) - .map(({ fileName, index }) => `${fileName} table #${index}`) - }) - - expect(missingScrollX).toEqual([]) - }) - - it('prevents backend table cells from breaking text into vertical columns', () => { - const adminLayout = readSource('views/admin/AdminLayout.vue') - - expect(adminLayout).not.toMatch(/\.mobile-content\s+:deep\(\.ant-table-cell\)\s*\{[\s\S]*overflow-wrap:\s*anywhere/) - expect(adminLayout).toContain('table-layout: auto;') - expect(adminLayout).toContain('width: max-content;') - expect(adminLayout).toContain('word-break: keep-all;') - }) - - it('keeps table ellipsis text content-sized without arbitrary character breaking', () => { - const ellipsisText = readSource('components/TableEllipsisText.vue') - - expect(ellipsisText).toContain('display: inline-block;') - expect(ellipsisText).not.toMatch(/^\s*width:\s*100%;$/m) - expect(ellipsisText).not.toContain('word-break: break-all;') - }) -}) diff --git a/FM-Frontend/src/views/web-theme-governance.test.ts b/FM-Frontend/src/views/web-theme-governance.test.ts deleted file mode 100644 index c9fbbf76..00000000 --- a/FM-Frontend/src/views/web-theme-governance.test.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readFileSync } from 'node:fs' -import { join } from 'node:path' - -const sourceRoot = join(process.cwd(), 'src') -const coreRoot = join(process.cwd(), '..', 'FM-Core', 'src', 'main', 'java') - -function readSource(relativePath: string) { - return readFileSync(join(sourceRoot, relativePath), 'utf-8') -} - -describe('web theme governance', () => { - it('keeps login pages on the shared shop theme variables', () => { - const authView = readSource('views/AuthView.vue') - const adminLoginView = readSource('views/admin/AdminLoginView.vue') - - expect(authView).not.toMatch(/#667eea|#764ba2/) - expect(authView).toContain('var(--theme-gradient)') - expect(authView).toContain('var(--theme-card-bg)') - expect(adminLoginView).not.toMatch(/--admin-mobile-accent|#d4866c|#c26e52/) - expect(adminLoginView).toContain('var(--theme-gradient)') - expect(adminLoginView).toContain('var(--theme-card-bg)') - }) - - it('does not reset admin routes back to an unrelated theme', () => { - const app = readSource('App.vue') - - expect(app).not.toMatch(/if\s*\(\s*isAdminPage\s*\)\s*\{\s*resetShopTheme\(\)/) - expect(app).not.toMatch(/route\.matched\.some\(r => r\.meta\.isAdmin\)\)\s*\{\s*resetShopTheme\(\)/) - expect(app).toContain("mode: 'admin'") - }) - - it('derives backend mobile colors from the active shop theme', () => { - const adminMobile = readSource('styles/admin-mobile.css') - - expect(adminMobile).toContain('--admin-mobile-ink: var(--text-primary);') - expect(adminMobile).toContain('--admin-mobile-card: var(--theme-card-bg);') - expect(adminMobile).toContain('--admin-mobile-accent: var(--theme-primary);') - expect(adminMobile).not.toMatch(/--admin-mobile-(?:ink|surface|card|accent|accent-strong|shell-start|shell-mid|shell-end):\s*#[0-9a-fA-F]{3,8}/) - expect(adminMobile).toContain('.admin-mobile-card__row strong') - expect(adminMobile).toContain('overflow-wrap: break-word;') - }) - - it('does not let feature pages redefine global theme variables', () => { - const systemMessages = readSource('views/admin/SystemMessagesView.vue') - - expect(systemMessages).not.toMatch(/--theme-primary:\s*#[0-9a-fA-F]{3,8}/) - expect(systemMessages).not.toMatch(/--theme-gradient:\s*linear-gradient\([^;]*#[0-9a-fA-F]{3,8}/) - }) - - it('keeps the web customer surface in a centered phone shell on desktop', () => { - const app = readSource('App.vue') - const globalStyle = readSource('style.css') - - expect(app).toContain('fingertip-designer-phone-frame') - expect(app).toContain('fingertip-designer-phone-frame--hidden-nav') - expect(globalStyle).toMatch(/--frontend-page-max-width:\s*430px/) - expect(globalStyle).toContain('--theme-neutral: #4A443F;') - expect(globalStyle).toContain('--theme-tertiary: #FDFBF9;') - expect(globalStyle).toContain('.fingertip-designer-phone-frame') - expect(globalStyle).toContain('.fingertip-designer-page') - expect(globalStyle).toContain('.fingertip-designer-glass-card') - expect(globalStyle).toContain('.fingertip-designer-status-chip') - expect(globalStyle).toContain('.fingertip-designer-bottom-action') - expect(globalStyle).toContain('max-width: var(--frontend-page-max-width);') - expect(globalStyle).not.toMatch(/--theme-primary:\s*#7C5357/) - }) - - it('keeps frontend and backend platform overview permission allowlists aligned', () => { - const frontend = readSource('utils/platform-admin-permissions.ts') - const backend = readFileSync(join(coreRoot, 'com', 'xiaowang', 'fingertipdesigner', 'core', 'modules', 'security', 'support', 'PermissionCatalog.java'), 'utf-8') - - expect(backend).toContain('"security:audit:view"') - expect(frontend).toContain("'security:audit:view'") - }) -}) diff --git a/FM-Frontend/tests/api/admin.stale-token.test.ts b/FM-Frontend/tests/api/admin.stale-token.test.ts deleted file mode 100644 index 378a93af..00000000 --- a/FM-Frontend/tests/api/admin.stale-token.test.ts +++ /dev/null @@ -1,112 +0,0 @@ -// @vitest-environment jsdom - -import { AxiosError, type AxiosAdapter, type AxiosResponse, type InternalAxiosRequestConfig } from 'axios' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -const messageError = vi.hoisted(() => vi.fn()) - -vi.mock('ant-design-vue', () => ({ - message: { - error: messageError - } -})) - -import adminApi from '../../src/api/admin' - -function createTokenExpiredError(config: InternalAxiosRequestConfig) { - const response = { - data: { - code: 401, - message: 'Token expired' - }, - status: 401, - statusText: 'Unauthorized', - headers: {}, - config, - request: {} - } as AxiosResponse - - return new AxiosError( - 'Request failed with status code 401', - AxiosError.ERR_BAD_REQUEST, - config, - {}, - response - ) -} - -describe('admin api stale token handling', () => { - const originalAdapter = adminApi.defaults.adapter - - beforeEach(() => { - vi.useFakeTimers() - messageError.mockClear() - window.history.replaceState(null, '', '/admin') - localStorage.clear() - sessionStorage.clear() - }) - - afterEach(() => { - adminApi.defaults.adapter = originalAdapter - localStorage.clear() - sessionStorage.clear() - vi.useRealTimers() - }) - - it('keeps a newer admin session when an old-token request returns 401', async () => { - localStorage.setItem('adminAccessToken', 'old-admin-token') - localStorage.setItem('adminRefreshToken', 'old-admin-refresh') - sessionStorage.setItem('adminAccessToken', 'old-admin-token') - - const requests: Array<{ url?: string, authorization?: string }> = [] - let markRequestStarted!: () => void - let releaseStale401!: () => void - const requestStarted = new Promise(resolve => { - markRequestStarted = resolve - }) - - adminApi.defaults.adapter = ((config: InternalAxiosRequestConfig) => { - if (config.url !== '/user/info') { - return Promise.reject(new Error(`Unexpected request: ${config.url}`)) - } - requests.push({ - url: config.url, - authorization: String(config.headers.Authorization || '') - }) - markRequestStarted() - return new Promise((_resolve, reject) => { - releaseStale401 = () => reject(createTokenExpiredError(config)) - }) - }) as AxiosAdapter - - const staleRequest = adminApi.get('/user/info') - - await requestStarted - expect(requests).toEqual([ - { - url: '/user/info', - authorization: 'Bearer old-admin-token' - } - ]) - - localStorage.setItem('adminAccessToken', 'new-admin-token') - localStorage.setItem('adminRefreshToken', 'new-admin-refresh') - sessionStorage.setItem('adminAccessToken', 'new-admin-token') - const hrefBefore401 = window.location.href - - releaseStale401() - - await expect(staleRequest).rejects.toMatchObject({ - response: { - status: 401 - } - }) - await vi.runAllTimersAsync() - - expect(localStorage.getItem('adminAccessToken')).toBe('new-admin-token') - expect(localStorage.getItem('adminRefreshToken')).toBe('new-admin-refresh') - expect(sessionStorage.getItem('adminAccessToken')).toBe('new-admin-token') - expect(window.location.href).toBe(hrefBefore401) - expect(messageError).not.toHaveBeenCalled() - }) -}) diff --git a/FM-Frontend/tests/api/vnext-api-contracts.test.ts b/FM-Frontend/tests/api/vnext-api-contracts.test.ts deleted file mode 100644 index b0793889..00000000 --- a/FM-Frontend/tests/api/vnext-api-contracts.test.ts +++ /dev/null @@ -1,125 +0,0 @@ -// @vitest-environment jsdom - -import type { AxiosAdapter, AxiosResponse, InternalAxiosRequestConfig } from 'axios' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -const messageError = vi.hoisted(() => vi.fn()) - -vi.mock('ant-design-vue', () => ({ - message: { - error: messageError - } -})) - -import adminApi, { - adminAfterSaleApi, - adminArtistScheduleApi, - adminCampaignApi, - adminDashboardApi, - adminInventoryApi, - adminPaymentApi -} from '../../src/api/admin' -import api from '../../src/api' -import { afterSaleApi, growthApi, paymentApi } from '../../src/api/order' - -type CapturedRequest = { - method?: string - url?: string - params?: any - data?: any -} - -function okResponse(config: InternalAxiosRequestConfig): AxiosResponse { - return { - data: { - code: 200, - message: 'ok', - data: {} - }, - status: 200, - statusText: 'OK', - headers: {}, - config, - request: {} - } -} - -function parseData(data: unknown) { - return typeof data === 'string' && data ? JSON.parse(data) : data -} - -function captureAdapter(requests: CapturedRequest[]): AxiosAdapter { - return (config: InternalAxiosRequestConfig) => { - requests.push({ - method: config.method, - url: config.url, - params: config.params, - data: parseData(config.data) - }) - return Promise.resolve(okResponse(config)) - } -} - -describe('vNext API contracts', () => { - const originalAdminAdapter = adminApi.defaults.adapter - const originalApiAdapter = api.defaults.adapter - - beforeEach(() => { - messageError.mockClear() - localStorage.clear() - sessionStorage.clear() - }) - - afterEach(() => { - adminApi.defaults.adapter = originalAdminAdapter - api.defaults.adapter = originalApiAdapter - localStorage.clear() - sessionStorage.clear() - }) - - it('uses backend admin vNext endpoints', async () => { - const requests: CapturedRequest[] = [] - adminApi.defaults.adapter = captureAdapter(requests) - - await adminArtistScheduleApi.listSchedules({ artistId: 9, startDate: '2026-06-01', endDate: '2026-06-07' }) - await adminArtistScheduleApi.saveSchedule({ artistId: 9, workDate: '2026-06-01', startTime: '09:00', endTime: '18:00' }) - await adminPaymentApi.manualConfirmOrder(42, 'cash verified') - await adminAfterSaleApi.listAfterSales({ status: 'APPLIED', page: 1, size: 20 }) - await adminAfterSaleApi.approveAfterSale(5, { auditReason: 'approved' }) - await adminInventoryApi.saveItem({ itemName: 'Base Gel', category: 'gel', unit: 'bottle', stockQuantity: 12 }) - await adminInventoryApi.adjustStock(7, { changeType: 'IN', changeQuantity: 3, remark: 'restock' }) - await adminCampaignApi.saveCampaign({ title: 'Summer Set', scene: 'HOME', status: 1 }) - await adminDashboardApi.getAnalytics() - - expect(requests).toEqual([ - { method: 'get', url: '/artist-schedule/list', params: { artistId: 9, startDate: '2026-06-01', endDate: '2026-06-07' }, data: undefined }, - { method: 'post', url: '/artist-schedule/save', params: undefined, data: { artistId: 9, workDate: '2026-06-01', startTime: '09:00', endTime: '18:00' } }, - { method: 'post', url: '/payment/order/42/manual-confirm', params: { remark: 'cash verified' }, data: undefined }, - { method: 'get', url: '/after-sale/list', params: { status: 'APPLIED', page: 1, size: 20 }, data: undefined }, - { method: 'put', url: '/after-sale/5/approve', params: undefined, data: { auditReason: 'approved' } }, - { method: 'post', url: '/inventory/save', params: undefined, data: { itemName: 'Base Gel', category: 'gel', unit: 'bottle', stockQuantity: 12 } }, - { method: 'post', url: '/inventory/7/adjust', params: undefined, data: { changeType: 'IN', changeQuantity: 3, remark: 'restock' } }, - { method: 'post', url: '/campaign/save', params: undefined, data: { title: 'Summer Set', scene: 'HOME', status: 1 } }, - { method: 'get', url: '/dashboard/analytics', params: undefined, data: undefined } - ]) - }) - - it('uses backend user vNext endpoints', async () => { - const requests: CapturedRequest[] = [] - api.defaults.adapter = captureAdapter(requests) - - await paymentApi.prepareOrderPayment(42) - await paymentApi.mockSuccess(42) - await afterSaleApi.apply({ orderId: 42, type: 'REFUND', reason: 'schedule changed', refundAmount: 88 }) - await afterSaleApi.listMy({ page: 1, size: 5 }) - await growthApi.getSummary() - - expect(requests).toEqual([ - { method: 'post', url: '/payment/order/42/prepare', params: undefined, data: undefined }, - { method: 'post', url: '/payment/order/42/mock-success', params: undefined, data: undefined }, - { method: 'post', url: '/after-sale/apply', params: undefined, data: { orderId: 42, type: 'REFUND', reason: 'schedule changed', refundAmount: 88 } }, - { method: 'get', url: '/after-sale/my', params: { page: 1, size: 5 }, data: undefined }, - { method: 'get', url: '/growth/summary', params: undefined, data: undefined } - ]) - }) -}) diff --git a/FD-Core/.mvn/wrapper/maven-wrapper.properties b/JC-ArtList-Core/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from FD-Core/.mvn/wrapper/maven-wrapper.properties rename to JC-ArtList-Core/.mvn/wrapper/maven-wrapper.properties diff --git a/FM-Core/pom.xml b/JC-ArtList-Core/pom.xml similarity index 97% rename from FM-Core/pom.xml rename to JC-ArtList-Core/pom.xml index c0e3ef42..6cf3f2e1 100644 --- a/FM-Core/pom.xml +++ b/JC-ArtList-Core/pom.xml @@ -11,10 +11,10 @@ com.xiaowang - JayuCloud-Salon-Core + JC-ArtList-Core 0.0.1 - JayuCloud-Salon-Core - JayuCloud-Salon-Core-店务核心业务微服务 + JC-ArtList-Core + JC-ArtList-Core-核心业务微服务 17 @@ -256,7 +256,7 @@ - JayuCloud-Salon-Core + JC-ArtList-Core org.springframework.boot @@ -285,7 +285,7 @@ + tofile="${project.basedir}/../docx/product/JC-ArtList-Core.jar"/> diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/FingertipDesignerCoreApplication.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/FingertipDesignerCoreApplication.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/FingertipDesignerCoreApplication.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/FingertipDesignerCoreApplication.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/annotation/OperationGuard.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/annotation/OperationGuard.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/annotation/OperationGuard.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/annotation/OperationGuard.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/annotation/RequirePermission.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/annotation/RequirePermission.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/annotation/RequirePermission.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/annotation/RequirePermission.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/aspect/OperationGuardAspect.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/aspect/OperationGuardAspect.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/aspect/OperationGuardAspect.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/aspect/OperationGuardAspect.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/aspect/PermissionAspect.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/aspect/PermissionAspect.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/aspect/PermissionAspect.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/aspect/PermissionAspect.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/BusinessException.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/BusinessException.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/BusinessException.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/BusinessException.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/GlobalExceptionHandler.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/GlobalExceptionHandler.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/GlobalExceptionHandler.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/GlobalExceptionHandler.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/Result.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/Result.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/Result.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/Result.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/dto/AgreementAwareRequest.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/dto/AgreementAwareRequest.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/dto/AgreementAwareRequest.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/dto/AgreementAwareRequest.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/entity/BaseEntity.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/entity/BaseEntity.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/entity/BaseEntity.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/entity/BaseEntity.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/vo/PageResultVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/vo/PageResultVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/vo/PageResultVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/common/vo/PageResultVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/AppCacheProperties.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/AppCacheProperties.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/AppCacheProperties.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/AppCacheProperties.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/AuthInterceptor.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/AuthInterceptor.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/AuthInterceptor.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/AuthInterceptor.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/BrandProperties.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/BrandProperties.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/BrandProperties.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/BrandProperties.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/HttpClientConfig.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/HttpClientConfig.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/HttpClientConfig.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/HttpClientConfig.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/HttpClientProperties.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/HttpClientProperties.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/HttpClientProperties.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/HttpClientProperties.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/JacksonConfig.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/JacksonConfig.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/JacksonConfig.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/JacksonConfig.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/JwtProperties.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/JwtProperties.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/JwtProperties.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/JwtProperties.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/LoginLockProperties.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/LoginLockProperties.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/LoginLockProperties.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/LoginLockProperties.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/MyBatisPlusConfig.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/MyBatisPlusConfig.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/MyBatisPlusConfig.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/MyBatisPlusConfig.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/MyMetaObjectHandler.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/MyMetaObjectHandler.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/MyMetaObjectHandler.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/MyMetaObjectHandler.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/ObjectStorageProperties.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/ObjectStorageProperties.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/ObjectStorageProperties.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/ObjectStorageProperties.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RabbitMQConfig.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RabbitMQConfig.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RabbitMQConfig.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RabbitMQConfig.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RateLimitProperties.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RateLimitProperties.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RateLimitProperties.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RateLimitProperties.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RedisConfig.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RedisConfig.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RedisConfig.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RedisConfig.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RequestSignatureProperties.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RequestSignatureProperties.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RequestSignatureProperties.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/RequestSignatureProperties.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SecurityHeadersFilter.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SecurityHeadersFilter.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SecurityHeadersFilter.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SecurityHeadersFilter.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SlowRequestLogProperties.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SlowRequestLogProperties.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SlowRequestLogProperties.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SlowRequestLogProperties.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SlowRequestLoggingInterceptor.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SlowRequestLoggingInterceptor.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SlowRequestLoggingInterceptor.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/SlowRequestLoggingInterceptor.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/UploadSecurityProperties.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/UploadSecurityProperties.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/UploadSecurityProperties.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/UploadSecurityProperties.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/WebMvcConfig.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/WebMvcConfig.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/WebMvcConfig.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/WebMvcConfig.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/WechatMiniProperties.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/WechatMiniProperties.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/WechatMiniProperties.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/WechatMiniProperties.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/filter/RequestBodyCacheFilter.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/filter/RequestBodyCacheFilter.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/filter/RequestBodyCacheFilter.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/filter/RequestBodyCacheFilter.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/controller/front/DashboardController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/controller/front/DashboardController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/controller/front/DashboardController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/controller/front/DashboardController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/OperationsAnalyticsService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/OperationsAnalyticsService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/OperationsAnalyticsService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/OperationsAnalyticsService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/WorkbenchService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/WorkbenchService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/WorkbenchService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/WorkbenchService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/impl/OperationsAnalyticsServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/impl/OperationsAnalyticsServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/impl/OperationsAnalyticsServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/impl/OperationsAnalyticsServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/impl/WorkbenchServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/impl/WorkbenchServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/impl/WorkbenchServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/service/impl/WorkbenchServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/DashboardStatsVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/DashboardStatsVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/DashboardStatsVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/DashboardStatsVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/OperationsAnalyticsVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/OperationsAnalyticsVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/OperationsAnalyticsVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/OperationsAnalyticsVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/RecentActivityVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/RecentActivityVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/RecentActivityVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/RecentActivityVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/StoreWorkbenchVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/StoreWorkbenchVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/StoreWorkbenchVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/analytics/vo/StoreWorkbenchVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/controller/front/NailArtistController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/controller/front/NailArtistController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/controller/front/NailArtistController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/controller/front/NailArtistController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleExceptionDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleExceptionDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleExceptionDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleExceptionDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleRuleDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleRuleDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleRuleDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/ArtistScheduleRuleDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/NailArtistInfoDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/NailArtistInfoDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/NailArtistInfoDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/dto/NailArtistInfoDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleExceptionDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleExceptionDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleExceptionDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleExceptionDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleRuleDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleRuleDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleRuleDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/ArtistScheduleRuleDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/NailArtistInfoDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/NailArtistInfoDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/NailArtistInfoDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/entity/NailArtistInfoDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleExceptionMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleExceptionMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleExceptionMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleExceptionMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleRuleMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleRuleMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleRuleMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/ArtistScheduleRuleMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/NailArtistInfoMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/NailArtistInfoMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/NailArtistInfoMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/mapper/NailArtistInfoMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/ArtistScheduleService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/ArtistScheduleService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/ArtistScheduleService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/ArtistScheduleService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/NailArtistInfoService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/NailArtistInfoService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/NailArtistInfoService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/NailArtistInfoService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/ArtistScheduleServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/ArtistScheduleServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/ArtistScheduleServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/ArtistScheduleServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/NailArtistInfoServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/NailArtistInfoServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/NailArtistInfoServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/service/impl/NailArtistInfoServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/support/BookableArtistSupport.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/support/BookableArtistSupport.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/support/BookableArtistSupport.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/support/BookableArtistSupport.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistCalendarAppointmentVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistCalendarAppointmentVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistCalendarAppointmentVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistCalendarAppointmentVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleExceptionVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleExceptionVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleExceptionVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleExceptionVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleRuleSettingVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleRuleSettingVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleRuleSettingVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleRuleSettingVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleRuleVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleRuleVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleRuleVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleRuleVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/ArtistScheduleVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistAvailabilityVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistAvailabilityVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistAvailabilityVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistAvailabilityVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistProfileVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistProfileVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistProfileVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistProfileVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistReviewVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistReviewVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistReviewVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistReviewVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistWorkVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistWorkVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistWorkVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/artist/vo/NailArtistWorkVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/controller/front/LoginIdentityController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/controller/front/LoginIdentityController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/controller/front/LoginIdentityController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/controller/front/LoginIdentityController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/BindEmailRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/BindEmailRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/BindEmailRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/BindEmailRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/BindPhoneRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/BindPhoneRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/BindPhoneRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/BindPhoneRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/LoginIdentityDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/LoginIdentityDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/LoginIdentityDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/LoginIdentityDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/LoginRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/LoginRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/LoginRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/LoginRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/PhoneLoginRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/PhoneLoginRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/PhoneLoginRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/PhoneLoginRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/RefreshTokenRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/RefreshTokenRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/RefreshTokenRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/RefreshTokenRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/RegisterRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/RegisterRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/RegisterRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/RegisterRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/ResetPasswordRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/ResetPasswordRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/ResetPasswordRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/ResetPasswordRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/SendVerificationCodeRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/SendVerificationCodeRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/SendVerificationCodeRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/SendVerificationCodeRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/SwitchShopRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/SwitchShopRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/SwitchShopRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/SwitchShopRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/UpdatePhoneRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/UpdatePhoneRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/UpdatePhoneRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/dto/UpdatePhoneRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/entity/LoginIdentityDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/entity/LoginIdentityDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/entity/LoginIdentityDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/entity/LoginIdentityDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/mapper/LoginIdentityMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/mapper/LoginIdentityMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/mapper/LoginIdentityMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/mapper/LoginIdentityMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/LoginIdentityService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/LoginIdentityService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/LoginIdentityService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/LoginIdentityService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/VerificationCodeService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/VerificationCodeService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/VerificationCodeService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/VerificationCodeService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/impl/LoginIdentityServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/impl/LoginIdentityServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/impl/LoginIdentityServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/impl/LoginIdentityServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/impl/VerificationCodeServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/impl/VerificationCodeServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/impl/VerificationCodeServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/service/impl/VerificationCodeServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginIdentityVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginIdentityVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginIdentityVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginIdentityVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginResponseVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginResponseVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginResponseVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginResponseVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginShopSelectionVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginShopSelectionVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginShopSelectionVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/auth/vo/LoginShopSelectionVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/controller/front/CommentController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/controller/front/CommentController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/controller/front/CommentController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/controller/front/CommentController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/dto/CommentDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/dto/CommentDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/dto/CommentDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/dto/CommentDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/entity/CommentDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/entity/CommentDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/entity/CommentDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/entity/CommentDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/mapper/CommentMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/mapper/CommentMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/mapper/CommentMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/mapper/CommentMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/service/CommentService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/service/CommentService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/service/CommentService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/service/CommentService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/service/impl/CommentServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/service/impl/CommentServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/service/impl/CommentServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/service/impl/CommentServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/vo/CommentVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/vo/CommentVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/vo/CommentVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/content/vo/CommentVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/AliyunOssConfig.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/AliyunOssConfig.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/AliyunOssConfig.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/AliyunOssConfig.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/MinioStorageConfig.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/MinioStorageConfig.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/MinioStorageConfig.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/MinioStorageConfig.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/QiniuKodoConfig.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/QiniuKodoConfig.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/QiniuKodoConfig.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/config/QiniuKodoConfig.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/controller/front/FrontendFileController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/controller/front/FrontendFileController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/controller/front/FrontendFileController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/controller/front/FrontendFileController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/controller/front/ObjectStorageFileController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/controller/front/ObjectStorageFileController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/controller/front/ObjectStorageFileController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/controller/front/ObjectStorageFileController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ChunkUploadCompleteRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ChunkUploadCompleteRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ChunkUploadCompleteRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ChunkUploadCompleteRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ChunkUploadInitRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ChunkUploadInitRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ChunkUploadInitRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ChunkUploadInitRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageBackupMessage.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageBackupMessage.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageBackupMessage.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageBackupMessage.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageFileDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageFileDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageFileDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageFileDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageReplicaDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageReplicaDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageReplicaDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageReplicaDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageUploadAttempt.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageUploadAttempt.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageUploadAttempt.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageUploadAttempt.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageUploadOutcome.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageUploadOutcome.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageUploadOutcome.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/dto/ObjectStorageUploadOutcome.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/entity/ObjectStorageFileDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/entity/ObjectStorageFileDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/entity/ObjectStorageFileDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/entity/ObjectStorageFileDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/entity/ObjectStorageReplicaDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/entity/ObjectStorageReplicaDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/entity/ObjectStorageReplicaDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/entity/ObjectStorageReplicaDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mapper/ObjectStorageFileMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mapper/ObjectStorageFileMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mapper/ObjectStorageFileMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mapper/ObjectStorageFileMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mapper/ObjectStorageReplicaMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mapper/ObjectStorageReplicaMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mapper/ObjectStorageReplicaMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mapper/ObjectStorageReplicaMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mq/ObjectStorageBackupMessageListener.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mq/ObjectStorageBackupMessageListener.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mq/ObjectStorageBackupMessageListener.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mq/ObjectStorageBackupMessageListener.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mq/ObjectStorageBackupMessagePublisher.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mq/ObjectStorageBackupMessagePublisher.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mq/ObjectStorageBackupMessagePublisher.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/mq/ObjectStorageBackupMessagePublisher.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/scheduler/ObjectStorageBackupRetryScheduler.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/scheduler/ObjectStorageBackupRetryScheduler.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/scheduler/ObjectStorageBackupRetryScheduler.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/scheduler/ObjectStorageBackupRetryScheduler.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/AliyunOssService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/AliyunOssService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/AliyunOssService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/AliyunOssService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ChunkUploadService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ChunkUploadService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ChunkUploadService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ChunkUploadService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageBackupService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageBackupService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageBackupService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageBackupService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageFileService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageFileService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageFileService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageFileService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageOrchestrationService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageOrchestrationService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageOrchestrationService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageOrchestrationService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageProvider.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageProvider.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageProvider.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageProvider.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageReplicaService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageReplicaService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageReplicaService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/ObjectStorageReplicaService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/PrimaryObjectStorageService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/PrimaryObjectStorageService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/PrimaryObjectStorageService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/PrimaryObjectStorageService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/AliyunOssServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/AliyunOssServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/AliyunOssServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/AliyunOssServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ChunkUploadServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ChunkUploadServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ChunkUploadServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ChunkUploadServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/MinioObjectStorageProvider.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/MinioObjectStorageProvider.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/MinioObjectStorageProvider.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/MinioObjectStorageProvider.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageBackupServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageBackupServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageBackupServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageBackupServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageFileServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageFileServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageFileServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageFileServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageOrchestrationServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageOrchestrationServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageOrchestrationServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageOrchestrationServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageReplicaServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageReplicaServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageReplicaServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/ObjectStorageReplicaServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/QiniuObjectStorageServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/QiniuObjectStorageServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/QiniuObjectStorageServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/service/impl/QiniuObjectStorageServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/support/ObjectStorageUrlSupport.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/support/ObjectStorageUrlSupport.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/support/ObjectStorageUrlSupport.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/support/ObjectStorageUrlSupport.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/vo/ChunkUploadSessionVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/vo/ChunkUploadSessionVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/vo/ChunkUploadSessionVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/vo/ChunkUploadSessionVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/vo/ObjectStorageFileVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/vo/ObjectStorageFileVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/vo/ObjectStorageFileVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/file/vo/ObjectStorageFileVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/controller/front/MessageHubPushConfigController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/controller/front/MessageHubPushConfigController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/controller/front/MessageHubPushConfigController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/controller/front/MessageHubPushConfigController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/MessageHubPushConfigDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/MessageHubPushConfigDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/MessageHubPushConfigDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/MessageHubPushConfigDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/MessageHubPushTestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/MessageHubPushTestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/MessageHubPushTestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/MessageHubPushTestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniAutoLoginRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniAutoLoginRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniAutoLoginRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniAutoLoginRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniConfirmLoginRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniConfirmLoginRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniConfirmLoginRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniConfirmLoginRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniPhoneLoginRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniPhoneLoginRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniPhoneLoginRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/dto/WechatMiniPhoneLoginRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/BusinessEventOutboxDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/BusinessEventOutboxDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/BusinessEventOutboxDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/BusinessEventOutboxDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/MessageHubPushConfigDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/MessageHubPushConfigDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/MessageHubPushConfigDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/MessageHubPushConfigDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/WechatMiniBindingDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/WechatMiniBindingDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/WechatMiniBindingDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/entity/WechatMiniBindingDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/BusinessEventOutboxMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/BusinessEventOutboxMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/BusinessEventOutboxMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/BusinessEventOutboxMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/MessageHubPushConfigMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/MessageHubPushConfigMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/MessageHubPushConfigMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/MessageHubPushConfigMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/WechatMiniBindingMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/WechatMiniBindingMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/WechatMiniBindingMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/mapper/WechatMiniBindingMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/BusinessEventOutboxService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/BusinessEventOutboxService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/BusinessEventOutboxService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/BusinessEventOutboxService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MapService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MapService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MapService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MapService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MessageHubClientService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MessageHubClientService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MessageHubClientService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MessageHubClientService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MessageHubPushConfigService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MessageHubPushConfigService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MessageHubPushConfigService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/MessageHubPushConfigService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/WechatMiniAuthService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/WechatMiniAuthService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/WechatMiniAuthService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/WechatMiniAuthService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/WechatMiniClientService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/WechatMiniClientService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/WechatMiniClientService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/WechatMiniClientService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/BusinessEventOutboxProcessor.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/BusinessEventOutboxProcessor.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/BusinessEventOutboxProcessor.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/BusinessEventOutboxProcessor.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/BusinessEventOutboxServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/BusinessEventOutboxServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/BusinessEventOutboxServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/BusinessEventOutboxServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MapServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MapServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MapServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MapServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MessageHubClientServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MessageHubClientServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MessageHubClientServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MessageHubClientServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MessageHubPushConfigServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MessageHubPushConfigServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MessageHubPushConfigServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/MessageHubPushConfigServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniAuthServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniAuthServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniAuthServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniAuthServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniClientServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniClientServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniClientServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/service/impl/WechatMiniClientServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/vo/MessageHubPushConfigVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/vo/MessageHubPushConfigVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/vo/MessageHubPushConfigVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/vo/MessageHubPushConfigVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/vo/WechatMiniLoginResultVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/vo/WechatMiniLoginResultVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/vo/WechatMiniLoginResultVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/integration/vo/WechatMiniLoginResultVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/dto/InventoryAdjustDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/dto/InventoryAdjustDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/dto/InventoryAdjustDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/dto/InventoryAdjustDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/dto/InventoryItemDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/dto/InventoryItemDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/dto/InventoryItemDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/dto/InventoryItemDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/entity/InventoryItemDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/entity/InventoryItemDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/entity/InventoryItemDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/entity/InventoryItemDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/entity/InventoryRecordDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/entity/InventoryRecordDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/entity/InventoryRecordDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/entity/InventoryRecordDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/mapper/InventoryItemMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/mapper/InventoryItemMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/mapper/InventoryItemMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/mapper/InventoryItemMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/mapper/InventoryRecordMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/mapper/InventoryRecordMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/mapper/InventoryRecordMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/mapper/InventoryRecordMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/service/InventoryService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/service/InventoryService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/service/InventoryService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/service/InventoryService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/service/impl/InventoryServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/service/impl/InventoryServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/service/impl/InventoryServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/service/impl/InventoryServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/vo/InventoryItemVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/vo/InventoryItemVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/vo/InventoryItemVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/inventory/vo/InventoryItemVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/manager/dto/ManagerCustomerCreateDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/manager/dto/ManagerCustomerCreateDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/manager/dto/ManagerCustomerCreateDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/manager/dto/ManagerCustomerCreateDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/CouponController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/CouponController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/CouponController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/CouponController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/GrowthController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/GrowthController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/GrowthController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/GrowthController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/ProductLikeController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/ProductLikeController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/ProductLikeController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/ProductLikeController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipBenefitController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipBenefitController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipBenefitController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipBenefitController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipInfoController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipInfoController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipInfoController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipInfoController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipRechargePlanController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipRechargePlanController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipRechargePlanController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/VipRechargePlanController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/WishlistController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/WishlistController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/WishlistController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/controller/front/WishlistController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/CampaignDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/CampaignDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/CampaignDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/CampaignDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/CouponDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/CouponDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/CouponDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/CouponDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipBenefitDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipBenefitDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipBenefitDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipBenefitDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipInfoDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipInfoDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipInfoDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipInfoDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipRechargePlanDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipRechargePlanDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipRechargePlanDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/VipRechargePlanDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistAddWithGroupDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistAddWithGroupDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistAddWithGroupDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistAddWithGroupDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistGroupDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistGroupDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistGroupDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistGroupDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistMoveDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistMoveDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistMoveDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/dto/WishlistMoveDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CampaignDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CampaignDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CampaignDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CampaignDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CouponDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CouponDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CouponDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CouponDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CouponTagDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CouponTagDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CouponTagDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/CouponTagDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/ProductLikeDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/ProductLikeDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/ProductLikeDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/ProductLikeDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/UserCouponDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/UserCouponDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/UserCouponDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/UserCouponDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipBenefitDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipBenefitDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipBenefitDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipBenefitDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipInfoDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipInfoDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipInfoDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipInfoDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipRechargePlanDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipRechargePlanDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipRechargePlanDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/VipRechargePlanDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/WishlistDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/WishlistDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/WishlistDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/WishlistDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/WishlistGroupDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/WishlistGroupDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/WishlistGroupDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/entity/WishlistGroupDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CampaignMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CampaignMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CampaignMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CampaignMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CouponMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CouponMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CouponMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CouponMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CouponTagMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CouponTagMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CouponTagMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/CouponTagMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/ProductLikeMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/ProductLikeMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/ProductLikeMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/ProductLikeMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/UserCouponMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/UserCouponMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/UserCouponMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/UserCouponMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipBenefitMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipBenefitMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipBenefitMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipBenefitMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipInfoMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipInfoMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipInfoMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipInfoMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipRechargePlanMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipRechargePlanMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipRechargePlanMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/VipRechargePlanMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/WishlistGroupMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/WishlistGroupMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/WishlistGroupMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/WishlistGroupMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/WishlistMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/WishlistMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/WishlistMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/mapper/WishlistMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/CampaignService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/CampaignService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/CampaignService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/CampaignService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/CouponService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/CouponService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/CouponService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/CouponService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/GrowthService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/GrowthService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/GrowthService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/GrowthService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/ProductLikeService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/ProductLikeService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/ProductLikeService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/ProductLikeService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipBenefitService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipBenefitService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipBenefitService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipBenefitService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipInfoService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipInfoService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipInfoService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipInfoService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipRechargePlanService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipRechargePlanService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipRechargePlanService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/VipRechargePlanService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/WishlistService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/WishlistService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/WishlistService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/WishlistService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/CampaignServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/CampaignServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/CampaignServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/CampaignServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/CouponServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/CouponServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/CouponServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/CouponServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/GrowthServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/GrowthServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/GrowthServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/GrowthServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/ProductLikeServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/ProductLikeServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/ProductLikeServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/ProductLikeServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipBenefitServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipBenefitServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipBenefitServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipBenefitServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipInfoServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipInfoServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipInfoServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipInfoServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipRechargePlanServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipRechargePlanServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipRechargePlanServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/VipRechargePlanServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/WishlistServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/WishlistServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/WishlistServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/service/impl/WishlistServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/CampaignVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/CampaignVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/CampaignVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/CampaignVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/CouponVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/CouponVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/CouponVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/CouponVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/GrowthSummaryVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/GrowthSummaryVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/GrowthSummaryVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/GrowthSummaryVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/UserCouponVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/UserCouponVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/UserCouponVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/UserCouponVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipBenefitVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipBenefitVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipBenefitVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipBenefitVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipInfoVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipInfoVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipInfoVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipInfoVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipRechargePlanVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipRechargePlanVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipRechargePlanVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/VipRechargePlanVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/WishlistGroupVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/WishlistGroupVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/WishlistGroupVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/WishlistGroupVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/WishlistInspirationVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/WishlistInspirationVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/WishlistInspirationVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/marketing/vo/WishlistInspirationVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/controller/front/AnnouncementController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/controller/front/AnnouncementController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/controller/front/AnnouncementController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/controller/front/AnnouncementController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/controller/front/SystemMessageController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/controller/front/SystemMessageController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/controller/front/SystemMessageController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/controller/front/SystemMessageController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/dto/AnnouncementCreateDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/dto/AnnouncementCreateDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/dto/AnnouncementCreateDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/dto/AnnouncementCreateDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/dto/SystemMessageCreateDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/dto/SystemMessageCreateDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/dto/SystemMessageCreateDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/dto/SystemMessageCreateDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/AnnouncementDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/AnnouncementDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/AnnouncementDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/AnnouncementDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/SystemMessageDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/SystemMessageDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/SystemMessageDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/SystemMessageDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/SystemMessageUserStateDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/SystemMessageUserStateDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/SystemMessageUserStateDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/entity/SystemMessageUserStateDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/AnnouncementMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/AnnouncementMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/AnnouncementMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/AnnouncementMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/SystemMessageMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/SystemMessageMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/SystemMessageMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/SystemMessageMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/SystemMessageUserStateMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/SystemMessageUserStateMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/SystemMessageUserStateMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/mapper/SystemMessageUserStateMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/AnnouncementService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/AnnouncementService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/AnnouncementService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/AnnouncementService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/SystemMessageService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/SystemMessageService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/SystemMessageService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/SystemMessageService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/impl/AnnouncementServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/impl/AnnouncementServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/impl/AnnouncementServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/impl/AnnouncementServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/impl/SystemMessageServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/impl/SystemMessageServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/impl/SystemMessageServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/service/impl/SystemMessageServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/AnnouncementVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/AnnouncementVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/AnnouncementVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/AnnouncementVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/MessageTargetOptionsVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/MessageTargetOptionsVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/MessageTargetOptionsVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/MessageTargetOptionsVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/MessageUnreadCountVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/MessageUnreadCountVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/MessageUnreadCountVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/MessageUnreadCountVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/SystemMessageVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/SystemMessageVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/SystemMessageVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/message/vo/SystemMessageVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/AfterSaleController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/AfterSaleController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/AfterSaleController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/AfterSaleController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/CartController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/CartController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/CartController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/CartController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/OrderController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/OrderController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/OrderController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/controller/front/OrderController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/AfterSaleApplyDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/AfterSaleApplyDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/AfterSaleApplyDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/AfterSaleApplyDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/AfterSaleAuditDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/AfterSaleAuditDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/AfterSaleAuditDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/AfterSaleAuditDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/CartDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/CartDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/CartDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/CartDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/CheckoutPreviewDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/CheckoutPreviewDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/CheckoutPreviewDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/CheckoutPreviewDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistChangeRejectDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistChangeRejectDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistChangeRejectDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistChangeRejectDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistChangeRequestDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistChangeRequestDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistChangeRequestDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistChangeRequestDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistReviewSubmitDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistReviewSubmitDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistReviewSubmitDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderArtistReviewSubmitDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderItemDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderItemDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderItemDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderItemDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteItemDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteItemDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteItemDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteItemDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteReplyDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteReplyDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteReplyDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteReplyDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteSubmitDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteSubmitDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteSubmitDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/dto/OrderQuoteSubmitDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/AfterSaleDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/AfterSaleDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/AfterSaleDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/AfterSaleDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/AfterSaleLogDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/AfterSaleLogDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/AfterSaleLogDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/AfterSaleLogDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/CartDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/CartDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/CartDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/CartDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderArtistChangeRequestDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderArtistChangeRequestDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderArtistChangeRequestDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderArtistChangeRequestDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderArtistReviewDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderArtistReviewDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderArtistReviewDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderArtistReviewDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderItemDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderItemDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderItemDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderItemDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderQuoteMessageDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderQuoteMessageDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderQuoteMessageDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/entity/OrderQuoteMessageDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/AfterSaleLogMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/AfterSaleLogMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/AfterSaleLogMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/AfterSaleLogMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/AfterSaleMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/AfterSaleMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/AfterSaleMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/AfterSaleMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/CartMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/CartMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/CartMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/CartMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderArtistChangeRequestMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderArtistChangeRequestMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderArtistChangeRequestMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderArtistChangeRequestMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderArtistReviewMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderArtistReviewMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderArtistReviewMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderArtistReviewMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderItemMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderItemMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderItemMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderItemMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderQuoteMessageMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderQuoteMessageMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderQuoteMessageMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/mapper/OrderQuoteMessageMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/AfterSaleService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/AfterSaleService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/AfterSaleService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/AfterSaleService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/CartService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/CartService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/CartService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/CartService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/OrderService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/OrderService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/OrderService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/OrderService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/AfterSaleServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/AfterSaleServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/AfterSaleServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/AfterSaleServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/CartServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/CartServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/CartServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/CartServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/OrderServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/OrderServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/OrderServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/service/impl/OrderServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/support/OrderStateMachine.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/support/OrderStateMachine.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/support/OrderStateMachine.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/support/OrderStateMachine.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/support/OrderStatus.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/support/OrderStatus.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/support/OrderStatus.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/support/OrderStatus.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/AfterSaleVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/AfterSaleVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/AfterSaleVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/AfterSaleVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CartArtistVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CartArtistVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CartArtistVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CartArtistVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CartVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CartVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CartVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CartVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CheckoutCouponPreviewVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CheckoutCouponPreviewVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CheckoutCouponPreviewVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CheckoutCouponPreviewVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CheckoutPreviewVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CheckoutPreviewVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CheckoutPreviewVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/CheckoutPreviewVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistChangeOptionsVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistChangeOptionsVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistChangeOptionsVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistChangeOptionsVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistChangeRequestVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistChangeRequestVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistChangeRequestVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistChangeRequestVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistReviewVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistReviewVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistReviewVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderArtistReviewVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderItemVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderItemVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderItemVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderItemVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderQuoteItemVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderQuoteItemVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderQuoteItemVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderQuoteItemVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderQuoteMessageVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderQuoteMessageVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderQuoteMessageVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderQuoteMessageVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order/vo/OrderVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/BalanceChangeDetailController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/BalanceChangeDetailController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/BalanceChangeDetailController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/BalanceChangeDetailController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/BalanceController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/BalanceController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/BalanceController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/BalanceController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/PaymentController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/PaymentController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/PaymentController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/controller/front/PaymentController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/dto/BalanceChangeDetailDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/dto/BalanceChangeDetailDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/dto/BalanceChangeDetailDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/dto/BalanceChangeDetailDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/dto/BalanceDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/dto/BalanceDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/dto/BalanceDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/dto/BalanceDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/BalanceChangeDetailDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/BalanceChangeDetailDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/BalanceChangeDetailDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/BalanceChangeDetailDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/BalanceDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/BalanceDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/BalanceDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/BalanceDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/PaymentOrderDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/PaymentOrderDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/PaymentOrderDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/PaymentOrderDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/RefundOrderDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/RefundOrderDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/RefundOrderDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/entity/RefundOrderDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/BalanceChangeDetailMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/BalanceChangeDetailMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/BalanceChangeDetailMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/BalanceChangeDetailMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/BalanceMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/BalanceMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/BalanceMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/BalanceMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/PaymentOrderMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/PaymentOrderMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/PaymentOrderMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/PaymentOrderMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/RefundOrderMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/RefundOrderMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/RefundOrderMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/mapper/RefundOrderMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/BalanceChangeDetailService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/BalanceChangeDetailService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/BalanceChangeDetailService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/BalanceChangeDetailService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/BalanceService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/BalanceService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/BalanceService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/BalanceService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/PaymentService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/PaymentService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/PaymentService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/PaymentService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/BalanceChangeDetailServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/BalanceChangeDetailServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/BalanceChangeDetailServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/BalanceChangeDetailServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/BalanceServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/BalanceServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/BalanceServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/BalanceServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/PaymentServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/PaymentServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/PaymentServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/service/impl/PaymentServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/BalanceChangeDetailVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/BalanceChangeDetailVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/BalanceChangeDetailVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/BalanceChangeDetailVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/BalanceVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/BalanceVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/BalanceVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/BalanceVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/PaymentOrderVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/PaymentOrderVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/PaymentOrderVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/PaymentOrderVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/RefundOrderVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/RefundOrderVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/RefundOrderVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/payment/vo/RefundOrderVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentCreateDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentCreateDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentCreateDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentCreateDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentMoveDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentMoveDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentMoveDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentMoveDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentStatusDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentStatusDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentStatusDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningAppointmentStatusDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningManagerRegisterDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningManagerRegisterDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningManagerRegisterDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/dto/PlanningManagerRegisterDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/entity/AppointmentReservationDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/entity/AppointmentReservationDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/entity/AppointmentReservationDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/entity/AppointmentReservationDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/mapper/AppointmentReservationMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/mapper/AppointmentReservationMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/mapper/AppointmentReservationMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/mapper/AppointmentReservationMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/AppointmentCapacityService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/AppointmentCapacityService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/AppointmentCapacityService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/AppointmentCapacityService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/PlanningService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/PlanningService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/PlanningService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/PlanningService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/AppointmentCapacityServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/AppointmentCapacityServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/AppointmentCapacityServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/AppointmentCapacityServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/PlanningServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/PlanningServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/PlanningServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/service/impl/PlanningServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/support/PlanningCalendarSupport.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/support/PlanningCalendarSupport.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/support/PlanningCalendarSupport.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/support/PlanningCalendarSupport.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningAppointmentVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningAppointmentVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningAppointmentVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningAppointmentVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningArtistCountVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningArtistCountVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningArtistCountVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningArtistCountVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningArtistVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningArtistVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningArtistVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningArtistVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningCalendarVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningCalendarVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningCalendarVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningCalendarVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningDaySummaryVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningDaySummaryVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningDaySummaryVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningDaySummaryVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningScheduleVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningScheduleVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningScheduleVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning/vo/PlanningScheduleVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/EffectDiagramController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/EffectDiagramController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/EffectDiagramController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/EffectDiagramController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/ProductController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/ProductController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/ProductController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/ProductController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/TagController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/TagController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/TagController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/controller/front/TagController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/EffectDiagramDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/EffectDiagramDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/EffectDiagramDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/EffectDiagramDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/ProductDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/ProductDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/ProductDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/ProductDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/TagDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/TagDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/TagDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/dto/TagDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/EffectDiagramDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/EffectDiagramDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/EffectDiagramDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/EffectDiagramDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/ProductDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/ProductDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/ProductDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/ProductDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/TagDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/TagDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/TagDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/entity/TagDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/EffectDiagramMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/EffectDiagramMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/EffectDiagramMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/EffectDiagramMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/ProductMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/ProductMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/ProductMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/ProductMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/TagMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/TagMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/TagMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/mapper/TagMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/EffectDiagramService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/EffectDiagramService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/EffectDiagramService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/EffectDiagramService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/ProductService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/ProductService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/ProductService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/ProductService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/TagService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/TagService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/TagService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/TagService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/EffectDiagramServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/EffectDiagramServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/EffectDiagramServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/EffectDiagramServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/ProductServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/ProductServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/ProductServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/ProductServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/TagServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/TagServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/TagServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/service/impl/TagServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/EffectDiagramVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/EffectDiagramVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/EffectDiagramVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/EffectDiagramVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/HotProductVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/HotProductVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/HotProductVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/HotProductVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/ProductVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/ProductVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/ProductVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/ProductVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagFilterGroupVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagFilterGroupVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagFilterGroupVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagFilterGroupVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagInfo.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagInfo.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagInfo.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagInfo.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product/vo/TagVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/front/PermissionController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/front/PermissionController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/front/PermissionController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/controller/front/PermissionController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/PermissionDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/PermissionDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/PermissionDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/PermissionDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/ShopRoleDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/ShopRoleDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/ShopRoleDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/ShopRoleDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/UserPermissionDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/UserPermissionDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/UserPermissionDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/dto/UserPermissionDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/PermissionDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/PermissionDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/PermissionDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/PermissionDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/SecurityAuditLogDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/SecurityAuditLogDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/SecurityAuditLogDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/SecurityAuditLogDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/ShopRoleDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/ShopRoleDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/ShopRoleDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/ShopRoleDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/ShopRolePermissionDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/ShopRolePermissionDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/ShopRolePermissionDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/ShopRolePermissionDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/UserPermissionDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/UserPermissionDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/UserPermissionDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/UserPermissionDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/UserShopRoleDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/UserShopRoleDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/UserShopRoleDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/entity/UserShopRoleDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/PermissionMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/PermissionMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/PermissionMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/PermissionMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/SecurityAuditLogMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/SecurityAuditLogMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/SecurityAuditLogMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/SecurityAuditLogMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/ShopRoleMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/ShopRoleMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/ShopRoleMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/ShopRoleMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/ShopRolePermissionMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/ShopRolePermissionMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/ShopRolePermissionMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/ShopRolePermissionMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/UserPermissionMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/UserPermissionMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/UserPermissionMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/UserPermissionMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/UserShopRoleMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/UserShopRoleMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/UserShopRoleMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/mapper/UserShopRoleMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/PermissionService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/PermissionService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/PermissionService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/PermissionService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/SecurityAuditLogService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/SecurityAuditLogService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/SecurityAuditLogService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/SecurityAuditLogService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/ShopRoleService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/ShopRoleService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/ShopRoleService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/ShopRoleService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/PermissionServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/PermissionServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/PermissionServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/PermissionServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/SecurityAuditLogServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/SecurityAuditLogServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/SecurityAuditLogServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/SecurityAuditLogServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/ShopRoleServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/ShopRoleServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/ShopRoleServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/service/impl/ShopRoleServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/AdminScopeHelper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/AdminScopeHelper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/AdminScopeHelper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/AdminScopeHelper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/PermissionCatalog.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/PermissionCatalog.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/PermissionCatalog.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/PermissionCatalog.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/PermissionPolicy.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/PermissionPolicy.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/PermissionPolicy.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/PermissionPolicy.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/SecurityAuditActions.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/SecurityAuditActions.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/SecurityAuditActions.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/SecurityAuditActions.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/SecurityAuditSupport.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/SecurityAuditSupport.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/SecurityAuditSupport.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/support/SecurityAuditSupport.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/PermissionVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/PermissionVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/PermissionVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/PermissionVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/SecurityAuditLogVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/SecurityAuditLogVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/SecurityAuditLogVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/SecurityAuditLogVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/ShopRoleVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/ShopRoleVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/ShopRoleVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security/vo/ShopRoleVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/controller/front/ContactInfoController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/controller/front/ContactInfoController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/controller/front/ContactInfoController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/controller/front/ContactInfoController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/controller/front/ShopController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/controller/front/ShopController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/controller/front/ShopController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/controller/front/ShopController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/dto/ShopDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/dto/ShopDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/dto/ShopDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/dto/ShopDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/entity/ShopDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/entity/ShopDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/entity/ShopDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/entity/ShopDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/entity/UserShopBindingDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/entity/UserShopBindingDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/entity/UserShopBindingDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/entity/UserShopBindingDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/mapper/ShopMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/mapper/ShopMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/mapper/ShopMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/mapper/ShopMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/mapper/UserShopBindingMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/mapper/UserShopBindingMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/mapper/UserShopBindingMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/mapper/UserShopBindingMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/ContactInfoService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/ContactInfoService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/ContactInfoService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/ContactInfoService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/ShopService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/ShopService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/ShopService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/ShopService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/impl/ContactInfoServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/impl/ContactInfoServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/impl/ContactInfoServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/impl/ContactInfoServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/impl/ShopServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/impl/ShopServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/impl/ShopServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/service/impl/ShopServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/support/ShopThemeSupport.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/support/ShopThemeSupport.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/support/ShopThemeSupport.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/support/ShopThemeSupport.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/support/UserShopBindingSupport.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/support/UserShopBindingSupport.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/support/UserShopBindingSupport.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/support/UserShopBindingSupport.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ContactInfoVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ContactInfoVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ContactInfoVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ContactInfoVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopSimpleVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopSimpleVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopSimpleVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopSimpleVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopTrustProfileVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopTrustProfileVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopTrustProfileVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopTrustProfileVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop/vo/ShopVO.java diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/HealthController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/HealthController.java similarity index 97% rename from FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/HealthController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/HealthController.java index aee333fa..4f930793 100644 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/HealthController.java +++ b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/HealthController.java @@ -49,7 +49,7 @@ public class HealthController { */ @GetMapping("/check") public Result check() { - return Result.success("JayuCloud-Salon-Core is running"); + return Result.success("JC-ArtList-Core is running"); } @GetMapping("/diagnostics") @@ -60,7 +60,7 @@ public class HealthController { */ public Result> diagnostics() { Map diagnostics = new LinkedHashMap<>(); - diagnostics.put("service", environment.getProperty("spring.application.name", "jayucloud-salon-core")); + diagnostics.put("service", environment.getProperty("spring.application.name", "jc-artlist-core")); diagnostics.put("port", environment.getProperty("server.port", "")); diagnostics.put("database", checkDatabase()); diagnostics.put("redis", checkRedis()); @@ -111,7 +111,7 @@ public class HealthController { private Map checkDiscovery() { Map result = new LinkedHashMap<>(); try { - String serviceName = environment.getProperty("spring.application.name", "jayucloud-salon-core"); + String serviceName = environment.getProperty("spring.application.name", "jc-artlist-core"); List instances = discoveryClient.getInstances(serviceName); result.put("ok", !instances.isEmpty()); result.put("service", serviceName); diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/LegalAgreementController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/LegalAgreementController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/LegalAgreementController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/LegalAgreementController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/SystemParameterConfigController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/SystemParameterConfigController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/SystemParameterConfigController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/controller/front/SystemParameterConfigController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/dto/LegalAgreementDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/dto/LegalAgreementDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/dto/LegalAgreementDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/dto/LegalAgreementDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/dto/SystemParameterConfigDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/dto/SystemParameterConfigDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/dto/SystemParameterConfigDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/dto/SystemParameterConfigDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/entity/LegalAgreementDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/entity/LegalAgreementDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/entity/LegalAgreementDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/entity/LegalAgreementDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/entity/SystemParameterConfigDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/entity/SystemParameterConfigDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/entity/SystemParameterConfigDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/entity/SystemParameterConfigDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/mapper/LegalAgreementMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/mapper/LegalAgreementMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/mapper/LegalAgreementMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/mapper/LegalAgreementMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/mapper/SystemParameterConfigMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/mapper/SystemParameterConfigMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/mapper/SystemParameterConfigMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/mapper/SystemParameterConfigMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/LegalAgreementService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/LegalAgreementService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/LegalAgreementService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/LegalAgreementService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/SystemParameterConfigService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/SystemParameterConfigService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/SystemParameterConfigService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/SystemParameterConfigService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/impl/LegalAgreementServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/impl/LegalAgreementServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/impl/LegalAgreementServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/impl/LegalAgreementServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/impl/SystemParameterConfigServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/impl/SystemParameterConfigServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/impl/SystemParameterConfigServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/service/impl/SystemParameterConfigServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/support/AdminDefaultPasswordSupport.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/support/AdminDefaultPasswordSupport.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/support/AdminDefaultPasswordSupport.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/support/AdminDefaultPasswordSupport.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/vo/LegalAgreementVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/vo/LegalAgreementVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/vo/LegalAgreementVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/vo/LegalAgreementVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/vo/SystemParameterConfigVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/vo/SystemParameterConfigVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/vo/SystemParameterConfigVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/system/vo/SystemParameterConfigVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/controller/front/UserController.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/controller/front/UserController.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/controller/front/UserController.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/controller/front/UserController.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/AdminUserBalanceChangeDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/AdminUserBalanceChangeDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/AdminUserBalanceChangeDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/AdminUserBalanceChangeDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/AdminUserVipOverrideDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/AdminUserVipOverrideDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/AdminUserVipOverrideDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/AdminUserVipOverrideDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/InviteCodeDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/InviteCodeDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/InviteCodeDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/InviteCodeDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/UserDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/UserDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/UserDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/UserDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/UserRelationUpdateDTO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/UserRelationUpdateDTO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/UserRelationUpdateDTO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/dto/UserRelationUpdateDTO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserAgreementConsentDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserAgreementConsentDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserAgreementConsentDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserAgreementConsentDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserGrowthRecordDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserGrowthRecordDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserGrowthRecordDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserGrowthRecordDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserInviteCodeDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserInviteCodeDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserInviteCodeDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserInviteCodeDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserRelationDO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserRelationDO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserRelationDO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/entity/UserRelationDO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserAgreementConsentMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserAgreementConsentMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserAgreementConsentMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserAgreementConsentMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserGrowthRecordMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserGrowthRecordMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserGrowthRecordMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserGrowthRecordMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserInviteCodeMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserInviteCodeMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserInviteCodeMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserInviteCodeMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserRelationMapper.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserRelationMapper.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserRelationMapper.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/mapper/UserRelationMapper.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/UserAssetService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/UserAssetService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/UserAssetService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/UserAssetService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/UserService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/UserService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/UserService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/UserService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/impl/UserAssetServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/impl/UserAssetServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/impl/UserAssetServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/impl/UserAssetServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/impl/UserServiceImpl.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/impl/UserServiceImpl.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/impl/UserServiceImpl.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/service/impl/UserServiceImpl.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/support/UserProfileFieldSupport.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/support/UserProfileFieldSupport.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/support/UserProfileFieldSupport.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/support/UserProfileFieldSupport.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/InviteCodeVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/InviteCodeVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/InviteCodeVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/InviteCodeVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserAgreementConsentVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserAgreementConsentVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserAgreementConsentVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserAgreementConsentVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserAssetVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserAssetVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserAssetVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserAssetVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserRelationVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserRelationVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserRelationVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserRelationVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserStatisticsVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserStatisticsVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserStatisticsVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserStatisticsVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserVO.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserVO.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserVO.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/user/vo/UserVO.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/RequestShopContext.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/RequestShopContext.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/RequestShopContext.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/RequestShopContext.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/cache/MultiLevelCacheService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/cache/MultiLevelCacheService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/cache/MultiLevelCacheService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/cache/MultiLevelCacheService.java diff --git a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/id/TimeOrderedSnowflakeIdGenerator.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/id/TimeOrderedSnowflakeIdGenerator.java similarity index 99% rename from FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/id/TimeOrderedSnowflakeIdGenerator.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/id/TimeOrderedSnowflakeIdGenerator.java index 85e346cb..f0851213 100644 --- a/FM-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/id/TimeOrderedSnowflakeIdGenerator.java +++ b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/id/TimeOrderedSnowflakeIdGenerator.java @@ -89,7 +89,7 @@ public class TimeOrderedSnowflakeIdGenerator { @Value("${snowflake.epoch:" + DEFAULT_EPOCH + "}") long configuredEpoch, @Value("${snowflake.worker-id:-1}") long configuredWorkerId, @Value("${snowflake.datacenter-id:-1}") long configuredDatacenterId, - @Value("${spring.application.name:jayucloud-salon-core}") String applicationName + @Value("${spring.application.name:jc-artlist-core}") String applicationName ) { this.epoch = configuredEpoch > 0 ? configuredEpoch : DEFAULT_EPOCH; this.datacenterId = resolveNodeId(configuredDatacenterId, MAX_DATACENTER_ID, resolveDatacenterId()); diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/CachedBodyHttpServletRequest.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/CachedBodyHttpServletRequest.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/CachedBodyHttpServletRequest.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/CachedBodyHttpServletRequest.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/OperationGuardService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/OperationGuardService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/OperationGuardService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/OperationGuardService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/OperationGuardStrategy.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/OperationGuardStrategy.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/OperationGuardStrategy.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/OperationGuardStrategy.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/RequestSignatureService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/RequestSignatureService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/RequestSignatureService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/RequestSignatureService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/RequestThrottleService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/RequestThrottleService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/RequestThrottleService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/RequestThrottleService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/UploadSecurityValidator.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/UploadSecurityValidator.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/UploadSecurityValidator.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/UploadSecurityValidator.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/UserSessionService.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/UserSessionService.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/UserSessionService.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/support/security/UserSessionService.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/AccountValidationUtils.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/AccountValidationUtils.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/AccountValidationUtils.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/AccountValidationUtils.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/JwtUtil.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/JwtUtil.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/JwtUtil.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/JwtUtil.java diff --git a/FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/RedisUtils.java b/JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/RedisUtils.java similarity index 100% rename from FD-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/RedisUtils.java rename to JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/utils/RedisUtils.java diff --git a/FD-Core/src/main/resources/application.yaml b/JC-ArtList-Core/src/main/resources/application.yaml similarity index 100% rename from FD-Core/src/main/resources/application.yaml rename to JC-ArtList-Core/src/main/resources/application.yaml diff --git a/FD-Core/src/main/resources/bootstrap.yaml b/JC-ArtList-Core/src/main/resources/bootstrap.yaml similarity index 98% rename from FD-Core/src/main/resources/bootstrap.yaml rename to JC-ArtList-Core/src/main/resources/bootstrap.yaml index 4f4ad7ff..f3f17fd9 100644 --- a/FD-Core/src/main/resources/bootstrap.yaml +++ b/JC-ArtList-Core/src/main/resources/bootstrap.yaml @@ -1,6 +1,6 @@ spring: application: - name: jayucloud-artlist-core + name: jc-artlist-core cloud: nacos: diff --git a/FM-Core/src/main/resources/log4j2.xml b/JC-ArtList-Core/src/main/resources/log4j2.xml similarity index 79% rename from FM-Core/src/main/resources/log4j2.xml rename to JC-ArtList-Core/src/main/resources/log4j2.xml index fc63d3ad..9563d53c 100644 --- a/FM-Core/src/main/resources/log4j2.xml +++ b/JC-ArtList-Core/src/main/resources/log4j2.xml @@ -2,7 +2,7 @@ %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n - E:/code/xiaowang/JayuCloud-Salon-Core/logs + E:/code/xiaowang/JC-ArtList-Core/logs @@ -11,8 +11,8 @@ - + @@ -20,14 +20,14 @@ - + - + @@ -36,14 +36,14 @@ - + - + @@ -51,7 +51,7 @@ - + diff --git a/FD-Frontend/.env.development b/JC-ArtList-Frontend/.env.development similarity index 100% rename from FD-Frontend/.env.development rename to JC-ArtList-Frontend/.env.development diff --git a/FD-Frontend/.env.production b/JC-ArtList-Frontend/.env.production similarity index 100% rename from FD-Frontend/.env.production rename to JC-ArtList-Frontend/.env.production diff --git a/FD-Frontend/.playwright-cli/page-2026-05-29T02-58-21-174Z.yml b/JC-ArtList-Frontend/.playwright-cli/page-2026-05-29T02-58-21-174Z.yml similarity index 100% rename from FD-Frontend/.playwright-cli/page-2026-05-29T02-58-21-174Z.yml rename to JC-ArtList-Frontend/.playwright-cli/page-2026-05-29T02-58-21-174Z.yml diff --git a/FD-Frontend/.vscode/extensions.json b/JC-ArtList-Frontend/.vscode/extensions.json similarity index 100% rename from FD-Frontend/.vscode/extensions.json rename to JC-ArtList-Frontend/.vscode/extensions.json diff --git a/FD-Frontend/index.html b/JC-ArtList-Frontend/index.html similarity index 100% rename from FD-Frontend/index.html rename to JC-ArtList-Frontend/index.html diff --git a/FM-Frontend/package-lock.json b/JC-ArtList-Frontend/package-lock.json similarity index 99% rename from FM-Frontend/package-lock.json rename to JC-ArtList-Frontend/package-lock.json index 6a0431d6..69af2377 100644 --- a/FM-Frontend/package-lock.json +++ b/JC-ArtList-Frontend/package-lock.json @@ -1,11 +1,11 @@ { - "name": "jayucloud-salon-frontend", + "name": "jc-artlist-frontend", "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "jayucloud-salon-frontend", + "name": "jc-artlist-frontend", "version": "0.0.1", "dependencies": { "@element-plus/icons-vue": "^2.3.2", diff --git a/FM-Frontend/package.json b/JC-ArtList-Frontend/package.json similarity index 95% rename from FM-Frontend/package.json rename to JC-ArtList-Frontend/package.json index f3fae2f4..2fe682f3 100644 --- a/FM-Frontend/package.json +++ b/JC-ArtList-Frontend/package.json @@ -1,5 +1,5 @@ { - "name": "jayucloud-salon-frontend", + "name": "jc-artlist-frontend", "private": true, "version": "0.0.1", "type": "module", diff --git a/FD-Frontend/public/assets/images/default-product.png b/JC-ArtList-Frontend/public/assets/images/default-product.png similarity index 100% rename from FD-Frontend/public/assets/images/default-product.png rename to JC-ArtList-Frontend/public/assets/images/default-product.png diff --git a/FD-Frontend/public/assets/images/default-shop.png b/JC-ArtList-Frontend/public/assets/images/default-shop.png similarity index 100% rename from FD-Frontend/public/assets/images/default-shop.png rename to JC-ArtList-Frontend/public/assets/images/default-shop.png diff --git a/FD-Frontend/public/fingertip-designer-icon.svg b/JC-ArtList-Frontend/public/fingertip-designer-icon.svg similarity index 100% rename from FD-Frontend/public/fingertip-designer-icon.svg rename to JC-ArtList-Frontend/public/fingertip-designer-icon.svg diff --git a/FD-Frontend/public/jiayu-designer-icon.png b/JC-ArtList-Frontend/public/jiayu-designer-icon.png similarity index 100% rename from FD-Frontend/public/jiayu-designer-icon.png rename to JC-ArtList-Frontend/public/jiayu-designer-icon.png diff --git a/FD-Frontend/public/vite.svg b/JC-ArtList-Frontend/public/vite.svg similarity index 100% rename from FD-Frontend/public/vite.svg rename to JC-ArtList-Frontend/public/vite.svg diff --git a/FD-Frontend/src/App.vue b/JC-ArtList-Frontend/src/App.vue similarity index 90% rename from FD-Frontend/src/App.vue rename to JC-ArtList-Frontend/src/App.vue index d0bdfda5..bca95544 100644 --- a/FD-Frontend/src/App.vue +++ b/JC-ArtList-Frontend/src/App.vue @@ -1,22 +1,8 @@