/// Represents the value of a dictionary item. This property is required and must not exceed 50 characters in length.
/// </summary>
/// <remarks>Ensure that the value provided is unique within its context to avoid conflicts.</remarks>
[Required(ErrorMessage = "字典值不能为空")]
[StringLength(50, ErrorMessage = "值长度不能超过50字符")]
publicstringValue{get;set;}=null!;
@ -83,8 +90,16 @@ namespace AGSS.Controllers.Dict
}
}
/// <summary>
/// Represents the data contract for updating a parent dictionary item.
/// This class is used to pass updated details of a parent dictionary item through HTTP requests.
/// </summary>
publicclassUpdateParentRequest
{
/// <summary>
/// Represents the label of a dictionary item. This property is used to uniquely identify or name the item within its context.
/// It is required and must not be null, with a maximum length of 100 characters. The label plays a crucial role in both creating and updating dictionary items, serving as a key identifier for operations performed on the dictionary structure.
/// Deletes a parent dictionary entry by its unique identifier.
/// </summary>
/// <param name="uuid">The unique identifier (UUID) of the parent dictionary entry to be deleted.</param>
/// <returns>An action result indicating the success or failure of the deletion operation. On success, returns a 200 status code with a confirmation message. In case of an exception, it returns a 200 status code with an error message and exception details.</returns>
/// Represents the label of a dictionary item. This property is required and must not be empty, as it uniquely identifies the dictionary entry within its parent context. It is used in both creation and update operations for dictionary items.
/// </summary>
/// <remarks>
/// The label should be descriptive and meaningful to easily identify the purpose or content of the dictionary item. It plays a crucial role in the user interface and backend logic, serving as a key identifier for related operations.
/// Represents the English label for a dictionary item. This property is optional and can be used to store an English translation or equivalent of the main label.
/// </summary>
/// <remarks>
/// This property is part of the request model for creating or updating a child dictionary item. It allows for the inclusion of an English label, enhancing multilingual support within the application.
/// </remarks>
publicstring?LabelEn{get;set;}
publicstring?Remark{get;set;}
/// <summary>
/// Represents an optional tag or identifier for a dictionary item. This property can be used to categorize or label the item in a way that is meaningful within the context of its usage, such as for filtering or searching purposes.
/// </summary>
publicstring?Tag{get;set;}
}
// 4.1 更新子项
[HttpPut("children/{uuid}")]
/// <summary>
/// Updates the details of a child dictionary item.
/// </summary>
/// <param name="uuid">The unique identifier of the child dictionary item to update.</param>
/// <param name="request">The request object containing the new values for the child dictionary item.</param>
/// <returns>An action result indicating the success or failure of the operation, including a message and an optional data payload.</returns>
/// Represents the request model used for updating a child item in the dictionary.
/// This class is utilized by the API endpoint responsible for modifying an existing child entry,
/// allowing changes to its label, value, and optional attributes such as English label, remarks, and tags.
/// </summary>
publicclassUpdateChildRequest
{
/// <summary>
/// Represents the label of a dictionary item. This property is required and must not be empty, as it uniquely identifies the dictionary item in a human-readable format.
/// </summary>
/// <remarks>
/// The Label is used to provide a meaningful name for the dictionary item that can be displayed in user interfaces or referenced in other parts of the application. It is crucial for the identification and management of dictionary items within the system.
/// Represents the value of a dictionary item. This property is required and must be provided when updating or creating a dictionary child item.
/// </summary>
/// <remarks>
/// The value is a unique identifier for the dictionary item within its parent context. It should be meaningful and reflect the nature of the item it represents.
/// Represents the English label for a dictionary item. This property can be used to store an English translation or alternative name for the dictionary entry, facilitating internationalization and localization efforts.
/// </summary>
/// <remarks>
/// This is an optional field; if not provided, it defaults to null, indicating no specific English label is set for the dictionary item.
/// </remarks>
publicstring?LabelEn{get;set;}
/// <summary>
/// Gets or sets the remark for the dictionary item. This property is optional and can be used to store additional information or comments about the dictionary item.
/// </summary>
publicstring?Remark{get;set;}
/// <summary>
/// Represents an optional tag associated with a dictionary item. This property can be used to categorize or provide additional metadata about the dictionary item.
/// </summary>
/// <remarks>
/// The Tag is not required and can be null. It serves as a flexible way to add extra information that can be used for filtering, sorting, or any other purpose as needed by the application.
/// </remarks>
publicstring?Tag{get;set;}
}
// 5. 删除子项
[HttpDelete("children/{uuid}")]
/// <summary>
/// Deletes a child item from the dictionary based on the provided unique identifier.
/// </summary>
/// <param name="uuid">The unique identifier (UUID) of the child item to be deleted.</param>
/// <returns>An action result indicating the success or failure of the deletion operation, encapsulated in a ReturnTemplate object which includes a status code, message, and additional data if any.</returns>
/// Represents a response object that is returned by API endpoints.
/// This class encapsulates the status code, message, and optionally data to provide a consistent structure for API responses.
/// </summary>
publicclassApiResponse
{
/// <summary>
/// Represents the status code of the API response. This property is used to indicate the outcome of an operation, such as success, error, or a specific HTTP status.
/// </summary>
/// <remarks>
/// The value of this property should be set based on the result of the operation being performed. It can be used by the client to determine the next steps or to handle the response appropriately.
/// </remarks>
publicintCode{get;set;}
/// <summary>
/// Represents a message or description associated with the API response. This property is used to provide additional information about the result of an operation, such as success messages, error details, or any other relevant information that needs to be communicated back to the client.
/// </summary>
publicstringMessage{get;set;}=null!;
}
/// <summary>
/// Represents a response from the API, containing a status code and message.
/// This class is used to provide a uniform structure for all API responses,
/// ensuring that clients can consistently handle and interpret the results of their requests.
/// </summary>
publicclassApiResponse<T>:ApiResponse
{
/// <summary>
/// Represents the data payload in the ApiResponse, containing the result of an API operation.
/// This property can hold any type of object that is being returned as part of the response from the server,
/// such as a list of items, a single item, or a custom object. The actual type of the data will be determined
/// by the generic type parameter T used with ApiResponse.
/// </summary>
/// <typeparam name="T">The type of the data being carried in the response.</typeparam>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.